Repository navigation
Fix pickle round-trip of Amazon provider exceptions and add their tests - #72824
Merged
Merged
Conversation
EcsTaskFailToStart.__reduce__ returned a bare string instead of a one-element tuple, so pickling it has raised PicklingError since apache#22002. WaiterTerminalFailure kept last_response outside args, so unpickling it failed with a missing-argument TypeError. Add a __reduce__ for it in the style of the ECS exceptions, add the missing test module for aws/exceptions.py, and drop its OVERLOOKED_TESTS entry.
potiuk
approved these changes
Sep 10, 2026
imrichardwu
pushed a commit
to imrichardwu/airflow
that referenced
this pull request
Sep 11, 2026
…ts (apache#72824) EcsTaskFailToStart.__reduce__ returned a bare string instead of a one-element tuple, so pickling it has raised PicklingError since apache#22002. WaiterTerminalFailure kept last_response outside args, so unpickling it failed with a missing-argument TypeError. Add a __reduce__ for it in the style of the ECS exceptions, add the missing test module for aws/exceptions.py, and drop its OVERLOOKED_TESTS entry.
1 task
xvega
pushed a commit
to xvega/airflow
that referenced
this pull request
Sep 13, 2026
…ts (apache#72824) EcsTaskFailToStart.__reduce__ returned a bare string instead of a one-element tuple, so pickling it has raised PicklingError since apache#22002. WaiterTerminalFailure kept last_response outside args, so unpickling it failed with a missing-argument TypeError. Add a __reduce__ for it in the style of the ECS exceptions, add the missing test module for aws/exceptions.py, and drop its OVERLOOKED_TESTS entry.
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.
While adding the missing unit tests for
airflow/providers/amazon/aws/exceptions.py(listed inOVERLOOKED_TESTSintest_project_structure.py, tracked in #35442), the pickle round-trip tests failed for two of the exceptions:EcsTaskFailToStart.__reduce__returns(EcsTaskFailToStart, (self.message)). The second item is a plain string instead of a one-element tuple, sopickle.dumps()raisesPicklingError: second item of the tuple returned by __reduce__ must be a tuple. The method was added in retry on very specific eni provision failures #22002, right after Fix EcsOperatorError, so it can be loaded from a picklefile #21441 fixed the same problem forEcsOperatorError, and has never worked.WaiterTerminalFailure(added in Preserve AWS waiter outcomes in trigger events #72455) keepslast_responseoutsideargs, so unpickling callsWaiterTerminalFailure(message)and fails withTypeError: __init__() missing 1 required positional argument: 'last_response'.Changes
exceptions.py: return a one-element tuple fromEcsTaskFailToStart.__reduce__; giveWaiterTerminalFailurea__reduce__that carrieslast_response, in the same style as the ECS exceptionstests/unit/amazon/aws/test_exceptions.py(new): message and attribute handling plus pickle round-trips for the exceptions that carry extra state, and inheritance, message, and round-trip checks for the plainAirflowExceptionsubclassestest_project_structure.py: remove the module fromOVERLOOKED_TESTSTesting
providers/amazon:tests/unit/amazon/aws/test_exceptions.py,tests/unit/amazon/aws/utils/test_waiter_with_logging.py,tests/unit/amazon/aws/hooks/test_ecs.py,tests/unit/amazon/aws/operators/test_ecs.pyairflow-core:tests/unit/always/test_project_structure.pyrelated: #35442
Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Claude Fable 5.1) following the guidelines. I reviewed and understand all changes; the tests were run locally as listed above.
🤖 Generated with Claude Code