Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Use common.compat.sdk for timezone imports in providers#70492

Open
FrankYang0529 wants to merge 1 commit into
apache:mainapache/airflow:mainfrom
FrankYang0529:claude/mypy-providers-timezone-error-1e5684FrankYang0529/airflow:claude/mypy-providers-timezone-error-1e5684Copy head branch name to clipboard
Open

Use common.compat.sdk for timezone imports in providers#70492
FrankYang0529 wants to merge 1 commit into
apache:mainapache/airflow:mainfrom
FrankYang0529:claude/mypy-providers-timezone-error-1e5684FrankYang0529/airflow:claude/mypy-providers-timezone-error-1e5684Copy head branch name to clipboard

Conversation

@FrankYang0529

Copy link
Copy Markdown
Member

Why

  • airflow.utils.timezone is now resolved at runtime by a module-level __getattr__. mypy cannot see dynamically produced attributes, so from airflow.utils import timezone fails with Module "airflow.utils" has no attribute "timezone" [attr-defined].
  • The mypy-providers hook only checks files included in the current push diff, so these pre-existing failures cannot be detected until an unrelated change happens to touch an affected file.

How

  • Replace the imports with from airflow.providers.common.compat.sdk import timezone.

Was generative AI tooling used to co-author this PR?
  • Yes - Claude Code

  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.

Signed-off-by: PoAn Yang <payang@apache.org>
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.

1 participant

Morty Proxy This is a proxified and sanitized view of the page, visit original site.