Move task instance state enums out of airflow.utils.state - #71193
Draft
rjgoyln wants to merge 2 commits into
Draft
Move task instance state enums out of airflow.utils.state#71193rjgoyln wants to merge 2 commits into
rjgoyln wants to merge 2 commits into
Conversation
airflow.utils has become a dumping ground, and untangling it is a prerequisite for the client-server separation work. TerminalTIState and IntermediateTIState describe the Execution API's task lifecycle protocol and belong next to TriggerRule and WeightRule, which moved to airflow.task for the same reason. The old import paths keep working through the same backwards-compatible shim that the sibling JobState move already established in this module.
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.
Summary
airflow.utilshas accumulated modules that belong elsewhere, and untangling it is a prerequisite for the client-server separation.TerminalTIStateandIntermediateTIStatedescribe the Execution API's task lifecycle protocol, so they move toairflow.task.state, whereTriggerRuleandWeightRulealready live. Enum values are unchanged, so the Execution API schema and the generated Task SDK client are untouched.The parent epic (#53385) names
airflow.sdk.definitions.stateas the target.airflow.task.stateis where the rest of this batch landed, the Task SDK never importedairflow.utils.state, and moving these into the SDK would add an airflow-core → task-sdk import that #62061 is working to remove. Straightforward to redirect if the epic's target is preferred.Both enums also drop off the
airflow.utils.statepage listed inpublic-airflow-interface.rstwithout a replacement entry, matching howtrigger_ruleandweight_rulewere handled.Compatibility
The old attribute paths still resolve and emit a
DeprecationWarning. The Google provider'sTYPE_CHECKINGimport moves to the new path because the old one no longer resolves statically.closes: #54899
closes: #54900
Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Opus 5) following the guidelines