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

   `DagProcessorAPIClient` (#74370) subclasses the Task SDK `Client`, which 
#73116 moved from `httpx` to `httpx2`. httpx2 has its own exception and 
transport classes, so the processor client's `except httpx.HTTPStatusError` / 
`httpx.HTTPError` / `httpx.ResponseNotRead` clauses stopped matching anything 
the client raises. Registration conflicts, closed-Job retirement and the early 
token-renewal fallbacks all fell through. On main, 
`dag_processing/test_api_client.py` and 
`execution_api/test_dag_processor_client.py` fail 86 of 98 tests, because 
`httpx.MockTransport` responses trip httpx2's `SyncByteStream` assertion.
   
   - Move the processor client and its two test modules to `httpx2`. The test 
changes are the mechanical `httpx` → `httpx2` swap; no assertions changed.
   - Let the Task SDK's `ServerResponseError.from_response` accept JSON errors 
whose `Content-Type` carries parameters (`application/json; charset=utf-8`) or 
different letter case. Those were raised as a bare `HTTPStatusError` with the 
body unread, so the processor client could not see the error `reason`.
   - Ban `httpx` imports in airflow-core with ruff (`TID251`), as task-sdk 
already does, so the next mix-up is a lint error instead of failing tests. The 
six modules not yet migrated are exempt until #70522 moves them (wider 
migration also in #74244).
   
   No newsfragment: the processor client has not been released yet.
   
   Tested locally: the two processor test modules go from 86 failed / 12 passed 
to 98 passed, and `task-sdk/tests/task_sdk/api` passes (142), including a new 
test that fails without the `from_response` change. prek pre-commit (including 
mypy for airflow-core and task-sdk) and manual stages pass. The full suites 
from `breeze verify` were left to CI.
   
   related: #70522
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes — Claude Code (Opus 5.5)
   
   Generated-by: Claude Code (Opus 5.5) following [the 
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
   


-- 
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