Skip to content

Conversation

@rsg17
Copy link
Contributor

@rsg17 rsg17 commented Mar 8, 2022

closes: #18267

Implements an option to keep_directory_structure.
True: Keep the destination directory structure
False: Create the source directory structure as specified by prefix


^ Add meaningful description above

Read the Pull Request Guidelines for more information.
In case of fundamental code change, 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 UPDATING.md.

@boring-cyborg boring-cyborg bot added area:providers provider:amazon AWS/Amazon - related issues labels Mar 8, 2022
@potiuk potiuk closed this Mar 8, 2022
@potiuk potiuk reopened this Mar 8, 2022
@potiuk potiuk merged commit c7286e5 into apache:main Mar 8, 2022
)

if not self.keep_directory_structure and self.prefix:
self.dest_s3_key = os.path.join(self.dest_s3_key, self.prefix)
Copy link
Contributor

Choose a reason for hiding this comment

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

will it work properly on Windows where os.path.join uses backslashes (\)? I think it should use posixpath instead

Copy link
Member

Choose a reason for hiding this comment

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

Feel free to make PR. Airflow only works on POSIX (for multiple reasons) but you are right it would be beter to even hardcode "/'".

Copy link
Contributor Author

@rsg17 rsg17 Mar 23, 2022

Choose a reason for hiding this comment

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

Will remember to use posixpath going forward. Actually, I referred to some of the code here when I did my PR.

Let me know if I should do the fix, I can get to it over the weekend..

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

Labels

area:providers provider:amazon AWS/Amazon - related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GCSToS3Operator : files already uploaded because of wrong prefix

3 participants