You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "eladkal (via GitHub)" <gi...@apache.org> on 2023/02/27 16:38:33 UTC

[GitHub] [airflow] eladkal commented on a diff in pull request #29694: `GoogleDriveHook`: Fixing log message + adding more verbose documentation

eladkal commented on code in PR #29694:
URL: https://github.com/apache/airflow/pull/29694#discussion_r1119002091


##########
airflow/providers/google/suite/hooks/drive.py:
##########
@@ -159,6 +160,57 @@ def exists(
             )
         )
 
+    def _get_file_info(self, file_id: str):
+        """
+        Returns Google API file_info object containing id, name, parents in the response
+        https://developers.google.com/drive/api/v3/reference/files/get
+
+        :param file_id: id as string representation of interested file
+        :return: file
+        """
+        file_info = (
+            self.get_conn().files()
+                .get(
+                fileId=file_id,
+                fields="id,name,parents",
+                supportsAllDrives=True,
+            ).execute()
+        )
+        return file_info

Review Comment:
   I think we need to handle case of exceptions from the API?



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org