Fix SecretCache import error in Python 3.14 with pytest-xdist#64525
Merged
amoghrajesh merged 1 commit intoapache:mainfrom Mar 31, 2026
Merged
Fix SecretCache import error in Python 3.14 with pytest-xdist#64525amoghrajesh merged 1 commit intoapache:mainfrom
amoghrajesh merged 1 commit intoapache:mainfrom
Conversation
jason810496
reviewed
Mar 31, 2026
Member
jason810496
left a comment
There was a problem hiding this comment.
Base on the PR description, haven't it already been solved in #64501 ?
jason810496
approved these changes
Mar 31, 2026
Member
jason810496
left a comment
There was a problem hiding this comment.
I just double-checked the timezone module and it make sense to. use lazy import as timezone module also import the conf.
airflow/task-sdk/src/airflow/sdk/timezone.py
Lines 19 to 33 in 28e08fc
Contributor
Author
|
Yes it was transitively importing it |
Contributor
Author
|
Failing tests being fixed by: #64524 |
Member
|
Indeed. That one is also needed. Cherry-picking |
potiuk
pushed a commit
to potiuk/airflow
that referenced
this pull request
Mar 31, 2026
…dist (apache#64525) (cherry picked from commit bcf74de) Co-authored-by: Amogh Desai <amoghrajesh1999@gmail.com>
potiuk
pushed a commit
to potiuk/airflow
that referenced
this pull request
Mar 31, 2026
…dist (apache#64525) (cherry picked from commit bcf74de) Co-authored-by: Amogh Desai <amoghrajesh1999@gmail.com>
1 task
Member
|
Cherry-picked #64537 |
potiuk
pushed a commit
to potiuk/airflow
that referenced
this pull request
Mar 31, 2026
…dist (apache#64525) (cherry picked from commit bcf74de) Co-authored-by: Amogh Desai <amoghrajesh1999@gmail.com>
Subham-KRLX
pushed a commit
to Subham-KRLX/airflow
that referenced
this pull request
Apr 3, 2026
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.
Was generative AI tooling used to co-author this PR?
We noticed this recently and couple more times, one example: https://github.com/apache/airflow/actions/runs/23764195368/job/69256787158
Error:
Turns out that when running tests with
pytest-xdistparallel execution for py 3.14, the multiprocessing manager subprocess fails to import the cache module due to a module-level timezone import that triggers conf initialization via__getattr__. In this specific subprocess context, the lazy module-level__getattr__mechanism does not work too reliably.I have a fix that moves the timezone import from module-level to method-level
within
_CacheValue.__init__()andis_expired(). This ensures that -the conf import chain
_CacheValueis actuallyinstantiated
{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.