Skip to content

Comments

Return list of destination URIs from HttpToGCSOperator#61306

Merged
potiuk merged 10 commits intoapache:mainfrom
Srabasti:http_to_gcs_pr
Feb 15, 2026
Merged

Return list of destination URIs from HttpToGCSOperator#61306
potiuk merged 10 commits intoapache:mainfrom
Srabasti:http_to_gcs_pr

Conversation

@Srabasti
Copy link
Contributor

@Srabasti Srabasti commented Feb 1, 2026

Changes per #11323 for http_to_gcs_operator

Was generative AI tooling used to co-author this PR?

Yes for tests - ChatGPT

@Srabasti Srabasti requested a review from shahar1 as a code owner February 1, 2026 07:34
@boring-cyborg boring-cyborg bot added area:providers provider:google Google (including GCP) related issues labels Feb 1, 2026
@Srabasti Srabasti marked this pull request as draft February 1, 2026 07:35
@Srabasti Srabasti marked this pull request as ready for review February 3, 2026 06:54
@uranusjr uranusjr changed the title Adding changes for http_to_gcs operator Add unwrap_single to HttpToGCSOperator Feb 5, 2026
@uranusjr
Copy link
Member

uranusjr commented Feb 5, 2026

Why do we need to do deprecation? From what I can tell, the operator does not return a value at all before the change, so we don’t need to consider compatibility? We can just add the argument and set the default to True.

Copy link
Contributor

@shahar1 shahar1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 one to the comment made by @uranusjr, and I'll take it a bit further - I'd probably avoid adding the unwrap_single parameter at all - as after aligning behavior of all relevant operators at some point in the future, we could think of deprecating the unwrap_single and return only list[str] (accessing a single value would be consistent and simple as lst[0]). To make such alignment easier, it would be the best to avoid this flag at all if it is not required for backward-compatbility.

@Srabasti
Copy link
Contributor Author

Srabasti commented Feb 9, 2026

Thanks for your review comments @uranusjr and @shahar1 !
Had made changes, assuming both True and False cases should be handled for unwrap_single field, for current state, to ensure failsafe for future. Since we are planning to remove it in long run, does not make sense to do that anymore.

Since am not aware of the past context, I was curious to learn the reason behind "unwrap_single" name has been chosen for this interim parameter name.

@shahar1
Copy link
Contributor

shahar1 commented Feb 10, 2026

Thanks for your review comments @uranusjr and @shahar1 ! Had made changes, assuming both True and False cases should be handled for unwrap_single field, for current state, to ensure failsafe for future. Since we are planning to remove it in long run, does not make sense to do that anymore.

Since am not aware of the past context, I was curious to learn the reason behind "unwrap_single" name has been chosen for this interim parameter name.

If you've made any changes, you might have forgotten to push them :)

Basically it was my idea for the naming - I took inspiration from KubernetesPodOperator that has the same parameter. As the name hints, it "unwraps" lists of single entities (e.g, ['gs://bucket/file']) into a string ('gs://bucket/file'). It's good for backward-compatibility for the cases that already return the single entity as default, but I think that for the long term it's better that all operators will return list[str], and the user will take care of the unwrapping if necessary (i.e., lst[0] for single entities).

In the case of HttpToGCSOperator, it doesn't return anything at the moment - so it's just a matter of return [f"gs://{self.bucket_name}/{self.object_name}"], testing this behavior, and that's all. No real need for unwrap_single.

@Srabasti
Copy link
Contributor Author

Thanks for the clarification @shahar1 as this helps me understand better the thought process behind choosing variable names!

Apologies for delay in response as it has been busy with items related to Airflow:)

@Srabasti Srabasti changed the title Add unwrap_single to HttpToGCSOperator Return list of destination URIs from HttpToGCSOperator Feb 12, 2026
@potiuk
Copy link
Member

potiuk commented Feb 14, 2026

Needs to update some tests though

@Srabasti
Copy link
Contributor Author

Yes am working on the tests..

@Srabasti
Copy link
Contributor Author

Breeze testing before changes implemented for test_http_to_gcs.py
image

Breeze testing after changes implemented for test_http_to_gcs.py
image

Used AI for generating tests.

Copy link
Contributor

@shahar1 shahar1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent job Srabasti!
Before merging we need to run the system tests for this operator to ensure that nothing breaks.
You may try doing it on your own, or wait until someone else does - if necessary, I will help with it during this week before cutting the release the new Google provider version, so this feature will be included.

@yuseok89 - maybe you could lend a hand? :)

CC: @VladaZakharova @MaksYermak

@yuseok89
Copy link
Contributor

@shahar1
I ran the system test for HttpToGCSOperator.

Test Screenshot

image

Copy link
Member

@potiuk potiuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@potiuk potiuk merged commit c06a78d into apache:main Feb 15, 2026
90 checks passed
choo121600 pushed a commit to choo121600/airflow that referenced this pull request Feb 22, 2026
* Adding changes for http_to_gcs operator

* Adding changes for http_to_gcs operator

* Adding tests

* Changes per review comments

* Changes per review comments

* Changes reverted for tests

* Changes reverted for tests

* Adding tests for http_to_gcs operator

* Adding tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:providers provider:google Google (including GCP) related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants