Move type-only third-party imports under TYPE_CHECKING in providers#67590
Open
omkar-334 wants to merge 3 commits into
Open
Move type-only third-party imports under TYPE_CHECKING in providers#67590omkar-334 wants to merge 3 commits into
omkar-334 wants to merge 3 commits into
Conversation
|
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide
|
a714401 to
c82d372
Compare
kaxil
reviewed
May 27, 2026
| from airflow.utils.log.logging_mixin import LoggingMixin | ||
|
|
||
| if TYPE_CHECKING: | ||
| from alibabacloud_adb20211201.models import SubmitSparkAppResponse |
Member
There was a problem hiding this comment.
No, not this of a change. What I meant is move imports where the module hasn't already been imported.
In this case alibabacloud_adb20211201.models is already imported on L26, so this change won't have any impact
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.
Third-party names that are only used in type annotations. Every file in this PR already has
from __future__ import annotations, so those annotations are stored as strings at runtime. The imports never need to be insys.modulesto make the code work; they only need to be resolvable for static analysis. No runtime imports were moved inlineRelated issue - #67515, #67519 (comment)
Each change is the same shape:
How candidates were picked
A small AST pass over
providers/*/srcflagged top-level third-party imports whose every reference falls in an annotation position (function args, returns,AnnAssign).Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code, following the guidelines