Skip to content

Conversation

@shahar1
Copy link
Contributor

@shahar1 shahar1 commented Apr 22, 2023

closes: #10426


This PR refactors GCS hook's method list() to support multiple prefixes passed as a list of strings.
It also updates GCSDeleteBucketOperator and GCSListObjectsOperator operators to utilize the updated hook.

^ Add meaningful description above

Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

@boring-cyborg boring-cyborg bot added area:providers provider:google Google (including GCP) related issues labels Apr 22, 2023
Comment on lines 740 to 755
Copy link
Contributor

@eladkal eladkal Apr 22, 2023

Choose a reason for hiding this comment

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

Do we need a new function for it?
Can't we add List[str] support for prefix parameter in list() function?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch, it indeed makes more sense to encapsulate the existing list method within an inner function and convert the list_by_prefix into the list method. Working on it.

@shahar1 shahar1 force-pushed the multiple-prefixes-in-gcs-hooks branch 2 times, most recently from e78043e to 3873ce4 Compare April 22, 2023 20:40
@shahar1 shahar1 force-pushed the multiple-prefixes-in-gcs-hooks branch from 3873ce4 to 52abaa0 Compare April 22, 2023 20:55
@shahar1 shahar1 changed the title Allow multiple prefixes in gcs delete/list hooks and operators Refactor GCS list hook to support multiple prefixes Apr 22, 2023
@shahar1 shahar1 requested a review from eladkal April 22, 2023 21:02
@eladkal eladkal merged commit 432697d into apache:main Apr 23, 2023
@shahar1 shahar1 deleted the multiple-prefixes-in-gcs-hooks branch June 12, 2024 13:14
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.

Multiple prefixes in GoogleCloudStorageListOperator and GoogleCloudStorageDeleteOperator

3 participants