You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
GCStoGCS operator not working when replace=False and source_object != destination_object #16967
The GCStoGCS operator using the replace=False flag and specifying source_object != destination_object, will not work properly, because it is comparing apples with pears.
Cause: the prefix in the pears case needs to be calculated from the destination_object, however, it is coming from the source_object.
existing_objects = hook.list(self.destination_bucket, prefix=prefix_, delimiter=delimiter)
# add an additional case
if self.destination_object is not None:
existing_objects = existing_objects.replace(prefix_, self.destination_object, 1)
objects = set(objects) - set(existing_objects)
Activity
boring-cyborg commentedon Jul 13, 2021
Thanks for opening your first issue here! Be sure to follow the issue template!
aslantar commentedon Jul 13, 2021
Possible solution:
potiuk commentedon Jul 13, 2021
Would you like to provide a PR with a fix @aslantar ? happy to review it.
aslantar commentedon Jul 13, 2021
Yes. I never contributed, but I'll find out and let you know.
aslantar commentedon Jul 15, 2021
@potiuk From my side it is ready for review #16991. I'd especially be interested how I can improve wrt. your coding guidelines.