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

Improve modules import in Airflow providers by some of them into a type-checking block #33754

Merged
merged 2 commits into from
Aug 27, 2023

Conversation

hussein-awala
Copy link
Member


^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

@potiuk
Copy link
Member

potiuk commented Aug 26, 2023

I wish we had other mechanism for that :)

@potiuk
Copy link
Member

potiuk commented Aug 26, 2023

BTW. This calls for automation and pre-commit. I think we should be able to have an AST pre-commit to verify if an import is only used in Type Hints (and ask to move them to if TYPE_CHECKING) - and the other way round - we could check if anything that is in TYPE_CHECKING is actually only used for type hints (cc: @uranusjr ).

@hussein-awala
Copy link
Member Author

I will add some pre-commits after merging the different PRs. I already prepared some of them including this one.

@potiuk
Copy link
Member

potiuk commented Aug 26, 2023

I will add some pre-commits after merging the different PRs. I already prepared some of them including this one.

I figured you are not doing it manually :)

@hussein-awala
Copy link
Member Author

I will try to split it in smaller PRs starting with the bigger providers (k8S, AWS, GCP, ...).

@hussein-awala hussein-awala marked this pull request as ready for review August 26, 2023 15:54
@potiuk
Copy link
Member

potiuk commented Aug 27, 2023

Providers are safe to merge since we do not cherry-pick them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants