[airflow] Expand module path check to individual symbols (AIR302)#17278
Merged
ntBre merged 22 commits intoastral-sh:mainfrom Apr 8, 2025
Merged
[airflow] Expand module path check to individual symbols (AIR302)#17278ntBre merged 22 commits intoastral-sh:mainfrom
airflow] Expand module path check to individual symbols (AIR302)#17278ntBre merged 22 commits intoastral-sh:mainfrom
Conversation
Skylion007
reviewed
Apr 7, 2025
Contributor
|
| code | total | + violation | - violation | + fix | - fix |
|---|---|---|---|---|---|
| AIR302 | 4 | 2 | 2 | 0 | 0 |
dff2a88 to
08a8742
Compare
Contributor
Author
|
@ntBre Hey, it would be nice if we could get this one reviewed. 🙏 The amount of change is enormous, but I tried to split the PR into 20 separate commits, so I hope it will be easier to review that way |
ntBre
approved these changes
Apr 7, 2025
Contributor
ntBre
left a comment
There was a problem hiding this comment.
Thanks! This was easy to review commit-by-commit. I had one suggestion, but I'm happy enough with the current version if you are.
crates/ruff_linter/src/rules/airflow/rules/moved_to_provider_in_3.rs
Outdated
Show resolved
Hide resolved
6ba71da to
b1d9dae
Compare
* airflow.sensors.s3_key_sensor.S3KeySensor → airflow.providers.amazon.aws.sensors.S3KeySensor * airflow.operators.sql.SQLThresholdCheckOperator → airflow.providers.common.sql.operators.sql.SQLThresholdCheckOperator * airflow.hooks.druid_hook.DruidDbApiHook → airflow.providers.apache.druid.hooks.druid.DruidDbApiHook * airflow.hooks.druid_hook.DruidHook → airflow.providers.apache.druid.hooks.druid.DruidHook * airflow.kubernetes.pod_generator.extend_object_field → airflow.providers.cncf.kubernetes.pod_generator.extend_object_field * airflow.kubernetes.pod_launcher.PodLauncher → airflow.providers.cncf.kubernetes.pod_launcher_deprecated.PodLauncher * airflow.kubernetes.pod_launcher.PodStatus → airflow.providers.cncf.kubernetes.pod_launcher_deprecated.PodStatus * airflow.kubernetes.pod_generator.PodDefaults → airflow.providers.cncf.kubernetes.pod_generator.PodDefaults * airflow.kubernetes.pod_launcher_deprecated.PodDefaults → airflow.providers.cncf.kubernetes.pod_launcher_deprecated.PodDefaults
b1d9dae to
2b039f0
Compare
ntBre
approved these changes
Apr 8, 2025
airflow] Expand module path check to individual symbols (AIR302)
dcreager
added a commit
that referenced
this pull request
Apr 9, 2025
* origin/main: [red-knot] Default `python-platform` to current platform (#17183) [red-knot] Add new 'unreachable code' test case (#17306) [red-knot] mypy_primer: Run on `async-utils` (#17303) [red-knot] Add custom `__setattr__` support (#16748) [red-knot] Add `__init__` arguments check when doing `try_call` on a class literal (#16512) [`flake8-pie`] Avoid false positive for multiple assignment with `auto()` (`PIE796`) (#17274) [syntax-errors] Async comprehension in sync comprehension (#17177) [`airflow`] Expand module path check to individual symbols (`AIR302`) (#17278) [syntax-errors] Check annotations in annotated assignments (#17283) [syntax-errors] Extend annotation checks to `await` (#17282) [red-knot] Add support for `assert_never` (#17287) [`flake8-pytest-style`] Avoid false positive for legacy form of `pytest.raises` (`PT011`) (#17231) [red-knot] Do not show types for literal expressions on hover (#17290) [red-knot] Fix dead-code clippy warning (#17291) [red-knot] Reachability analysis (#17199) [red-knot] Don't use latency-sensitive for handlers (#17227)
dcreager
added a commit
that referenced
this pull request
Apr 9, 2025
* dcreager/special-class: (26 commits) lint Add TODO about property test data Better todos Narrow type(generic) better More Python-like displays for specializations Add xfail for generic method inside generic class Comment other non-specializations Explain self_instance not being specialized Generic aliases are literals in type display Better TODO fallback type [red-knot] Default `python-platform` to current platform (#17183) [red-knot] Add new 'unreachable code' test case (#17306) [red-knot] mypy_primer: Run on `async-utils` (#17303) [red-knot] Add custom `__setattr__` support (#16748) [red-knot] Add `__init__` arguments check when doing `try_call` on a class literal (#16512) [`flake8-pie`] Avoid false positive for multiple assignment with `auto()` (`PIE796`) (#17274) [syntax-errors] Async comprehension in sync comprehension (#17177) [`airflow`] Expand module path check to individual symbols (`AIR302`) (#17278) [syntax-errors] Check annotations in annotated assignments (#17283) [syntax-errors] Extend annotation checks to `await` (#17282) ...
Glyphack
pushed a commit
to Glyphack/ruff
that referenced
this pull request
Apr 9, 2025
…astral-sh#17278) ## Summary ### Improvement Expand the following moved module into individual symbols. * airflow.triggers.temporal * airflow.triggers.file * airflow.triggers.external_task * airflow.hooks.subprocess * airflow.hooks.package_index * airflow.hooks.filesystem * airflow.sensors.weekday * airflow.sensors.time_delta * airflow.sensors.time_sensor * airflow.sensors.date_time * airflow.operators.weekday * airflow.operators.datetime * airflow.operators.bash This removes `Replacement::ImportPathMoved`. ## Fix During the expansion, the following paths were also fixed * airflow.sensors.s3_key_sensor.S3KeySensor → airflow.providers.amazon.aws.sensors.S3KeySensor * airflow.operators.sql.SQLThresholdCheckOperator → airflow.providers.common.sql.operators.sql.SQLThresholdCheckOperator * airflow.hooks.druid_hook.DruidDbApiHook → airflow.providers.apache.druid.hooks.druid.DruidDbApiHook * airflow.hooks.druid_hook.DruidHook → airflow.providers.apache.druid.hooks.druid.DruidHook * airflow.kubernetes.pod_generator.extend_object_field → airflow.providers.cncf.kubernetes.pod_generator.extend_object_field * airflow.kubernetes.pod_launcher.PodLauncher → airflow.providers.cncf.kubernetes.pod_launcher_deprecated.PodLauncher * airflow.kubernetes.pod_launcher.PodStatus → airflow.providers.cncf.kubernetes.pod_launcher_deprecated.PodStatus * airflow.kubernetes.pod_generator.PodDefaults → airflow.providers.cncf.kubernetes.pod_generator.PodDefaults * airflow.kubernetes.pod_launcher_deprecated.PodDefaults → airflow.providers.cncf.kubernetes.pod_launcher_deprecated.PodDefaults ### Refactor As many symbols are moved into the same module, `SourceModuleMovedToProvider` is introduced for grouping similar logic ## Test Plan
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Improvement
Expand the following moved module into individual symbols.
This removes
Replacement::ImportPathMoved.Fix
During the expansion, the following paths were also fixed
Refactor
As many symbols are moved into the same module,
SourceModuleMovedToProvideris introduced for grouping similar logicTest Plan