Skip to content
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

Check that airflow module is seen for AIR001 #14627

Merged
merged 1 commit into from
Nov 27, 2024

Conversation

dhruvmanila
Copy link
Member

No description provided.

@dhruvmanila dhruvmanila added the internal An internal refactor or improvement label Nov 27, 2024
Comment on lines -72 to +77
.is_some_and(|qualified_name| matches!(qualified_name.segments()[0], "airflow"))
.is_some_and(|qualified_name| matches!(qualified_name.segments(), ["airflow", ..]))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @uranusjr is the AIR001 rule valid for any symbols that's being imported from the airflow module? As per the rule documentation, it seems to mention specifically "Airflow Operators", so should this be restricted to airflow.operators.*?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It probably should be restricted to airflow.operators.* and airflow.providers.**.operators.*.

@dhruvmanila dhruvmanila enabled auto-merge (squash) November 27, 2024 07:22
@dhruvmanila dhruvmanila merged commit 0d649f9 into main Nov 27, 2024
20 checks passed
@dhruvmanila dhruvmanila deleted the dhruv/check-airflow-module branch November 27, 2024 07:25
Copy link
Contributor

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

dhruvmanila added a commit that referenced this pull request Dec 4, 2024
## Summary

This PR makes changes to the `AIR001` rule as per
#14627 (comment).

Additionally,
* Avoid returning the `Diagnostic` and update the checker in the rule
logic for consistency
* Remove test case for different keyword position (I don't think it's
required here)

## Test Plan

Add test cases for multiple operators from various modules.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal An internal refactor or improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants