potiuk commented on code in PR #29694:
URL: https://github.com/apache/airflow/pull/29694#discussion_r1116774627
##########
airflow/providers/google/suite/hooks/drive.py:
##########
@@ -243,8 +284,13 @@ def upload_file(
.create(body=file_metadata, media_body=media, fields="id",
supportsAllDrives=True)
.execute(num_retries=self.num_retries)
)
- self.log.info("File %s uploaded to gdrive://%s.", local_location,
remote_location)
- return file.get("id")
+ file_id = file.get("id")
+
+ upload_location = (
Review Comment:
I think having to do the traverse up the directories hierarchy is a
convenience and I think maybe it should be guarded by a parameter
("show_full_target_path") in the `upload` method which might be set to `true`
by default?
If not for the performance, it will also give the escape hatch in case for
some reason the traversal will be problematic. I can imagine a number of cases
- for example it could be that the file is in a place that you can upload a
file but you can only have permissions to look at some part of the tree. Not
sure if it might happen in GDrive, but this can - for example - happen in
regular POSIX filesystem.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]