[airflow] Extract AIR311 from AIR301 rules (AIR301, AIR311)#17310
[airflow] Extract AIR311 from AIR301 rules (AIR301, AIR311)#17310ntBre merged 10 commits intoastral-sh:mainfrom
airflow] Extract AIR311 from AIR301 rules (AIR301, AIR311)#17310Conversation
7ced201 to
c0271b6
Compare
airflow] Extract AIR311 from AIR301 rules (AIR301, AIR311)
|
| code | total | + violation | - violation | + fix | - fix |
|---|---|---|---|---|---|
| AIR311 | 134 | 134 | 0 | 0 | 0 |
| AIR301 | 134 | 0 | 134 | 0 | 0 |
|
Hey @ntBre , I might have some refactoring on this one but would appreciate it if we could get an early review to see if I'm doing things right. Thanks 🙂 |
|
@ntBre After a second check, I think this is ready to be reviewed. Thanks! |
eab4f77 to
2a681b3
Compare
ntBre
left a comment
There was a problem hiding this comment.
Thanks! Just some minor nits, but this looks great overall.
crates/ruff_linter/src/rules/airflow/rules/suggested_to_update_3_0.rs
Outdated
Show resolved
Hide resolved
...r/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR311_AIR311_args.py.snap
Outdated
Show resolved
Hide resolved
|
btw do you know when will the next version be released? |
Should be this Thursday! |
|
Is this ready for one more quick review and then merging? I see the comments are resolved, but I don't see any new commits. Maybe GitHub is showing things out of order, though. |
|
@ntBre yep, this is ready. I guess I might have fixed up some commits (but there should still have one or two new commits 🤔 |
2a681b3 to
1a06c1d
Compare
|
in case of anything missed, i just rebase from the latest main and pushed again |
1a06c1d to
785cb1b
Compare
ntBre
left a comment
There was a problem hiding this comment.
Thanks! I have one more question about a rule code. Is there somewhere that both Airflow3SuggestedUpdate and Airflow3Removal are being emitted? I'm a bit confused how both rules are active at once since the test_case should only be activating Airflow3SuggestedUpdate.
...r/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR311_AIR311_args.py.snap
Outdated
Show resolved
Hide resolved
* arguments
* `airflow..DAG
dag`
* `sla_miss_callback`
* operators
* `sla`
* name
* `airflow.Dataset]
[airflow.datasets.Dataset` → `airflow.sdk.Asset`
* `airflow.datasets, rest @ ..`
* `DatasetAlias` → `airflow.sdk.AssetAlias`
* `DatasetAll` → `airflow.sdk.AssetAll`
* `DatasetAny` → `airflow.sdk.AssetAny`
* `expand_alias_to_datasets` → `airflow.sdk.expand_alias_to_assets`
* `metadata.Metadata` → `airflow.sdk.Metadata`
<!--airflow.models.baseoperator-->
* `airflow.models.baseoperator.chain` → `airflow.sdk.chain`
* `airflow.models.baseoperator.chain_linear` → `airflow.sdk.chain_linear`
* `airflow.models.baseoperator.cross_downstream` → `airflow.sdk.cross_downstream`
* `airflow.models.baseoperatorlink.BaseOperatorLink` → `airflow.sdk.definitions.baseoperatorlink.BaseOperatorLink`
* `airflow.timetables, rest @ ..`
* `datasets.DatasetOrTimeSchedule` → * `airflow.timetables.assets.AssetOrTimeSchedule`
* `airflow.utils, rest @ ..`
<!--airflow.utils.dag_parsing_context-->
* `dag_parsing_context.get_parsing_context` → `airflow.sdk.get_parsing_context`
785cb1b to
2b8bce1
Compare
* main: (44 commits) [`airflow`] Extend `AIR311` rules (#17422) [red-knot] simplify union size limit handling (#17429) [`airflow`] Extract `AIR311` from `AIR301` rules (`AIR301`, `AIR311`) (#17310) [red-knot] set a size limit on unions of literals (#17419) [red-knot] make large-union benchmark slow again (#17418) [red-knot] optimize building large unions of literals (#17403) [red-knot] Fix comments in type_api.md (#17425) [red-knot] Do not assume that `x != 0` if `x` inhabits `~Literal[0]` (#17370) [red-knot] make large-union benchmark more challenging (#17416) [red-knot] Acknowledge that `T & anything` is assignable to `T` (#17413) Update Rust crate clap to v4.5.36 (#17381) Raise syntax error when `\` is at end of file (#17409) [red-knot] Add regression tests for narrowing constraints cycles (#17408) [red-knot] Add some knowledge of `__all__` to `*`-import machinery (#17373) Update taiki-e/install-action digest to be7c31b (#17379) Update Rust crate mimalloc to v0.1.46 (#17382) Update PyO3/maturin-action action to v1.49.1 (#17384) Update Rust crate anyhow to v1.0.98 (#17380) dependencies: switch from `chrono` to `jiff` Update Rust crate bstr to v1.12.0 (#17385) ...
Summary
As discussed in #14626 (comment), we're to separate suggested changes from required changes.
The following symbols have been moved to AIR311 from AIR301. They still work in Airflow 3.0, but they're suggested to be changed as they're expected to be removed in a future version.
airflow..DAG | dagsla_miss_callbackslaairflow.Dataset] | [airflow.datasets.Dataset→airflow.sdk.Assetairflow.datasets, rest @ ..DatasetAlias→airflow.sdk.AssetAliasDatasetAll→airflow.sdk.AssetAllDatasetAny→airflow.sdk.AssetAnyexpand_alias_to_datasets→airflow.sdk.expand_alias_to_assetsmetadata.Metadata→airflow.sdk.Metadataairflow.models.baseoperator.chain→airflow.sdk.chainairflow.models.baseoperator.chain_linear→airflow.sdk.chain_linearairflow.models.baseoperator.cross_downstream→airflow.sdk.cross_downstreamairflow.models.baseoperatorlink.BaseOperatorLink→airflow.sdk.definitions.baseoperatorlink.BaseOperatorLinkairflow.timetables, rest @ ..datasets.DatasetOrTimeSchedule→ *airflow.timetables.assets.AssetOrTimeScheduleairflow.utils, rest @ ..dag_parsing_context.get_parsing_context→airflow.sdk.get_parsing_contextTest Plan
The test fixture has been updated acccordingly