Skip to content

Fix pickle round-trip of Amazon provider exceptions and add their tests - #72824

Merged
potiuk merged 1 commit into
apache:mainfrom
bingqin2:amazon-exceptions-tests
Sep 10, 2026
Merged

potiuk merged 1 commit into
apache:mainfrom
bingqin2:amazon-exceptions-tests

Conversation

@bingqin2

@bingqin2 bingqin2 commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

While adding the missing unit tests for airflow/providers/amazon/aws/exceptions.py (listed in OVERLOOKED_TESTS in test_project_structure.py, tracked in #35442), the pickle round-trip tests failed for two of the exceptions:

Changes

  • exceptions.py: return a one-element tuple from EcsTaskFailToStart.__reduce__; give WaiterTerminalFailure a __reduce__ that carries last_response, in the same style as the ECS exceptions
  • tests/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 plain AirflowException subclasses
  • test_project_structure.py: remove the module from OVERLOOKED_TESTS

Testing

  • 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.py
  • airflow-core: tests/unit/always/test_project_structure.py
  • prek hooks on the changed files

related: #35442


Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

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

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
potiuk merged commit ab45296 into apache:main Sep 10, 2026
83 checks passed
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.
@bingqin2
bingqin2 deleted the amazon-exceptions-tests branch September 11, 2026 05:47
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:providers provider:amazon AWS/Amazon - related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants