Repository navigation
Preserve DELETE request bodies in HttpAsyncHook - #72720
Conversation
|
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide
|
3b94308 to
354c194
Compare
potiuk
left a comment
There was a problem hiding this comment.
The fix is correct and minimal: AsyncHttpSession.run() now forwards data for DELETE just like the sync HttpHook.run() already does, and as providers/http/docs/operators.rst documents for its own DELETE example ("passing form data to the request"). _get_request_func already mapped DELETE to session.delete, so the body forward was the only thing missing.
The new parametrized test genuinely fails without the change, and specs its mock with spec=aiohttp.ClientSession.delete — stricter than the surrounding tests in that class. Thanks for that.
Smaller observations
- The
use_external_sessionparametrization exercises the pre-existing session dispatch inHttpAsyncHook.run(); both branches reach the same changed line throughAsyncHttpSession.run(), so it doubles the cases without adding coverage of the fix. Cheap and harmless, so keeping it is fine. - Not for this PR: after this change the async set is
{"POST", "PUT", "PATCH", "DELETE"}, while the sync hook forwardsdatafor every method exceptGETandHEAD. SoOPTIONS, which_get_request_funcdoes support, still drops its body in the async path. Mirroring the sync condition would remove the last asymmetry.
This review was drafted by an AI-assisted tool and
confirmed by an Apache Airflow maintainer. The maintainer
approving this PR has read the findings and signed off. If
something feels off, please reply on the PR and a maintainer
will follow up.More on how Apache Airflow handles maintainer review:
contributing-docs/05_pull_requests.rst.
|
Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions. |
HttpAsyncHook silently drops
datasupplied to DELETE requests. Forward the request body to aiohttp, matching the synchronous HttpHook behavior. Add regression coverage for string and form payloads with both hook-managed and externally supplied sessions.Validation in a scoped Breeze environment: 134 HTTP provider tests passed (one version-specific skip), mypy passed for all 29 HTTP-provider files, and provider metadata validation passed. All four regressions fail without the fix. Ruff and applicable fast/manual checks passed; the all-provider mypy sweep and broader CI matrix remain pending.
Was generative AI tooling used to co-author this PR?
Generated-by: OpenAI Codex (gpt-6-astra) following the guidelines