When attempting to use the GoogleDriveToGCSOperator
via a Service Account, I am only able to interact with folders I create directly within the My Drive
path in Drive. If I use a different Team/Shared Drive, I receive errors even though the Team drive has also granted permissions to the Service Account.
upload_gdrive_to_gcs = GoogleDriveToGCSOperator(
task_id="upload_gdrive_object_to_gcs",
folder_id="my-folder-id-here",
file_name="abc.txt",
bucket_name="gdrive-testbucket",
object_name="testfile.txt",
gcp_conn_id='google_cloud_default',
)
This operator for example produces the below error when trying to use the Team drive:
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/airflow/providers/google/cloud/transfers/gdrive_to_gcs.py", line 126, in execute
gdrive_hook.download_file(file_id=file_metadata["id"], file_handle=file)
KeyError: 'id'
But if I simply switch the folder_id
to a folder within my own My Drive
path, it is successful. Both My Drive
and the shared Team drive are sharing the same access/permissions to the service account.
Has anyone run into this and were able to get these operators to work with the Team drive folders?