Rohitkanithi opened a new pull request, #72823:
URL: https://github.com/apache/airflow/pull/72823

   ### Why
   
   1. `providers/amazon/src/airflow/providers/amazon/aws/exceptions.py` was on 
the `OVERLOOKED_TESTS` allowlist in 
`airflow-core/tests/unit/always/test_project_structure.py`, tracked under 
meta-issue #35442.
   2. In `EcsTaskFailToStart`, the `__reduce__` method returned 
`EcsTaskFailToStart, (self.message)`. In Python, `(self.message)` is evaluated 
as a parenthesized string expression rather than a 1-element tuple, which 
causes `pickle.dumps()` across multiprocessing/Celery worker boundaries to fail 
with `_pickle.PicklingError: second item of the tuple returned by __reduce__ 
must be a tuple`.
   
   ### How
   
   1. Fixed `EcsTaskFailToStart.__reduce__` to return a proper 1-element tuple: 
`(self.message,)`, matching the reduce pattern used in `EcsOperatorError`.
   2. Created `providers/amazon/tests/unit/amazon/aws/test_exceptions.py` with 
19 test cases covering:
      - `EcsTaskFailToStart` initialization, string conversion, and pickle 
serialization roundtrip via `__reduce__`.
      - `EcsOperatorError` failures list preservation, message handling, and 
pickle serialization roundtrip.
      - S3 exceptions (`S3HookUriParseFailure`, `S3HookPathTraversalError`) and 
`AirflowException` inheritance.
      - Neptune graph and endpoint exceptions (6 classes).
      - Glue exception (`GlueJobRunStoppedError`).
      - DataSync exceptions (6 classes).
      - Waiter exceptions (`WaiterTerminalFailure` with `last_response` 
attribute, `WaiterMaxAttemptsError`).
   3. Removed `providers/amazon/tests/unit/amazon/aws/test_exceptions.py` from 
`OVERLOOKED_TESTS`.
   
   ### What
   
   19 unit tests added and 1 bugfix in `EcsTaskFailToStart`.
   
   Verified locally:
   ```
   uv run --project providers/amazon pytest 
providers/amazon/tests/unit/amazon/aws/test_exceptions.py -v
   # 19 passed, 1 warning in 1.31s
   
   uv run --project airflow-core pytest 
airflow-core/tests/unit/always/test_project_structure.py -k 
test_providers_modules_should_have_tests -v
   # 1 passed, 10 deselected in 1.78s
   ```
   
   related: #35442
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [ ] Yes (please specify the tool below)
   
   ---
   
   * Read the **[Pull Request 
Guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#pull-request-guidelines)**
 for more information. Note: commit author/co-author name and email in commits 
become permanently public when merged.
   * For fundamental code changes, an Airflow Improvement Proposal 
([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvement+Proposals))
 is needed.
   * When adding dependency, check compliance with the [ASF 3rd Party License 
Policy](https://www.apache.org/legal/resolved.html#category-x).
   * For significant user-facing changes create newsfragment: 
`{pr_number}.significant.rst`, in 
[airflow-core/newsfragments](https://github.com/apache/airflow/tree/main/airflow-core/newsfragments).
 You can add this file in a follow-up commit after the PR is created so you 
know the PR number.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to