Log the HTTP response in HttpToGCSOperator when log_response is set - #72952
Merged
Merged
Conversation
12 tasks
potiuk
approved these changes
Sep 20, 2026
potiuk
left a comment
Member
There was a problem hiding this comment.
This is a correct, minimal fix for a genuine silent no-op — log_response was accepted, documented and stored by HttpToGCSOperator but never read in execute(), and the two added lines mirror what HttpOperator.process_response() already does. The parametrized regression test fails without the fix and no existing test or behaviour was touched.
Smaller observations
- One test-style nit inline about
caplog.text. - The commit carries a
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>trailer. Per the repo guidelines, "Never list an agent as a commit co-author" — the checked Gen-AI disclosure plus theGenerated-by:line in the PR body is the sanctioned form. I'm dropping that trailer from the squash commit message, so nothing to do on your side.
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.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
potiuk
force-pushed
the
http-to-gcs-log-response
branch
from
September 20, 2026 17:17
dc1e7d8 to
4496c3d
Compare
caplog.text is a legacy string-matching API the testing standards ask us to avoid, and the documented "in caplog" replacement is not usable here: the google provider supports Airflow 2.11+, and in the compat jobs caplog falls back to the stock pytest fixture, which has no __contains__. Patching task.log.info follows the http provider's own test for this feature and drops the log-capture machinery entirely. Generated-by: Claude Opus 5
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.
HttpToGCSOperatordocumentslog_response("Log the response (default: False)") and stores it, butexecute()never reads it, so the response body is never logged no matter what the user sets. This logsresponse.textafter the request when the flag is set, the same wayHttpOperatordoes.Changes
providers/google/src/airflow/providers/google/cloud/transfers/http_to_gcs.py: log the response text whenlog_responseis trueproviders/google/tests/unit/google/cloud/transfers/test_http_to_gcs.py:test_execute_logs_response_only_when_requested, parametrized over both valuesTesting
providers/google:tests/unit/google/cloud/transfers/test_http_to_gcs.pyWas 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