Repository navigation
Add missing tests for common.compat.standard operators and triggers - #73262
Merged
shahar1 merged 2 commits intoSep 17, 2026
Merged
Conversation
No test under providers/ covered these two compatibility shims directly, and both were exempted from the project-structure guard, so a broken fallback import would only have surfaced through a downstream provider. Claude-Session: https://claude.ai/code/session_018eXNgswooRJJY6s1cXniYB
|
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
|
kaxil
reviewed
Sep 17, 2026
BaseAsyncOperator and is_async_callable are bound by the version gate, so the _IMPORT_MAP entries pointing at compat.sdk never resolved. Drop both keys and keep the names in __all__, and drop the unknown-attribute tests that duplicate test__compat_utils.py, per review. Claude-Session: https://claude.ai/code/session_018eXNgswooRJJY6s1cXniYB
shahar1
approved these changes
Sep 17, 2026
|
Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions. |
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.
Neither
common.compat.standard.operatorsnorcommon.compat.standard.triggershad a test module, and nothing under anyproviders/*/tests/directory imported them, so a broken fallback import in either shim would only have surfaced in a downstream provider. Both were also exempted in theOVERLOOKED_TESTSallowlist inairflow-core/tests/unit/always/test_project_structure.py.This adds the two test modules and removes those two allowlist entries, following the existing pattern in
providers/common/compat/tests/unit/common/compat/test_sdk.pyand the shape of the sibling PR #72487.What the tests cover:
__all__equals a hardcoded expected export list, so an accidentally removed compat export is caught. The list is deliberately hardcoded rather than derived from__all__, following the review feedback on Add tests for common compat standard utilities #72487.Noneobject.is_async_callabledetects coroutine functions through nestedfunctools.partialwrappers. The cases asserted are only those that hold on both sides of the Airflow 3.2 fork, so the local stub and the Task SDK implementation agree on all of them.BaseAsyncOperatorstub reportsis_async is Trueand itsexecute()raisesRuntimeError.How this was verified
Docker is not available on my machine, so the
breeze testing providers-tests ...commands in the issue's Definition of Done could not be run. I used the local virtualenv route documented incontributing-docs/07_local_virtualenv.rstinstead:Every prek hook in that stage passes except
check-tests-in-the-right-folders, which exits early becausebreezeis not on my PATH. I ranscripts/ci/prek/check_tests_in_right_folders.pydirectly on the changed core test file and it passes.The provider run also reports 2 errors in
connection/test_connection.py(ModuleNotFoundError: No module named 'airflow_shared'). They are present unchanged onmainat the same commit and are an artifact of my local venv, not of this change.Red then green on the guard test: with the two allowlist entries removed but the test modules not yet added,
test_providers_modules_should_have_testsfails withDetect missing tests in providers module - please add testslisting both paths. Adding the modules makes it pass.The two version-gated stub tests are skipped locally, since the checkout is Airflow 3.4.0. I exercised that branch in a throwaway process with
AIRFLOW_V_3_2_PLUSpatched toFalse, which makesoperators.pydefine the stub: all 19 tests in the new directory then pass, including the two stub tests. The providers compatibility matrix jobs (Airflow 2.11.1, 3.0.6, 3.1.8) are what exercise that branch for real.Dead
_IMPORT_MAPentries, now fixed hereThe
_IMPORT_MAPentries forBaseAsyncOperatorandis_async_callablepointed atairflow.providers.common.compat.sdk, which exports neither name. They resolved only becauseoperators.pybinds both at module level on each side of theAIRFLOW_V_3_2_PLUSgate, which shadows the module__getattr__. Per review, that is fixed in this PR rather than a follow-up: both keys are removed, so every remaining key really does route throughcreate_module_getattr, which is what the resolve-each-export test now exercises.__all__keeps all nine names. A literal list trips ruffF822for the seven lazily resolved names, and there is nonoqa: F822precedent in the repo, so it stays computed in the house style ofsdk.py:operators.__all__is unchanged, both names still import directly, and the seven mapped names still resolve through the fallback chain.Note on overlap: #72487 also adds
providers/common/compat/tests/unit/common/compat/standard/__init__.py. If it merges first I will rebase and drop that file from this diff. I left itsOVERLOOKED_TESTSentry fortest_utils.pyuntouched.closes: #72263
related: #35442
Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Opus 5) following the guidelines
🤖 Generated with Claude Code
https://claude.ai/code/session_018eXNgswooRJJY6s1cXniYB