-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[airflow
] Extract AIR311
from AIR301
rules (AIR301
, AIR311
)
#17310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 | dag
sla_miss_callback
sla
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.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 @ ..
dag_parsing_context.get_parsing_context
→airflow.sdk.get_parsing_context
Test Plan
The test fixture has been updated acccordingly