eladkal commented on code in PR #29694:
URL: https://github.com/apache/airflow/pull/29694#discussion_r1124323895
##########
airflow/providers/google/suite/hooks/drive.py:
##########
@@ -243,8 +292,21 @@ 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 = remote_location
+
+ if folder_id != "root":
+ try:
+ upload_location = self._resolve_file_path(folder_id)
+ except GoogleApiClientError as e:
+ self.log.warning("A problem has been encountered when trying
to resolve file path: ", e)
+
+ if show_full_target_path:
+ self.log.info("File %s uploaded to gdrive://%s.", local_location,
upload_location)
+ else:
+ self.log.info("File %s has been uploaded successfully to gdrive",
local_location)
Review Comment:
i think this parameter is redundant?
It doesn't give any additional value. Lets just print the full path. if
someone doesn't need the full path they can just remove `gdrive://` from the
path
--
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]