Skip to content

Comments

Check that airflow module is seen for AIR001#14627

Merged
dhruvmanila merged 1 commit intomainfrom
dhruv/check-airflow-module
Nov 27, 2024
Merged

Check that airflow module is seen for AIR001#14627
dhruvmanila merged 1 commit intomainfrom
dhruv/check-airflow-module

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
@dhruvmanila dhruvmanila deleted the dhruv/check-airflow-module branch November 27, 2024 07:25
@github-actions
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