Skip to content
This repository has been archived by the owner on Jul 22, 2021. It is now read-only.

Shared Drive Metadata Fetch Unsupported #228

Open
7mt opened this issue Apr 27, 2021 · 2 comments
Open

Shared Drive Metadata Fetch Unsupported #228

7mt opened this issue Apr 27, 2021 · 2 comments

Comments

@7mt
Copy link

7mt commented Apr 27, 2021

The Handling Special Metadata section of the docs highlights the following use case of the FetchMetadata() function:

file1 = drive.CreateFile({'id': '<some file ID here>'})

# Fetches all basic metadata fields, including file size, last modified etc.
file1.FetchMetadata()

However, this does not work if file1 is a shared drive. When file1 is a shared drive,

shared_drive = client.CreateFile({'teamDriveId': shared_drive_id})
print(shared_drive['id'])

returns a GoogleDriveFile object with blank metadata (i.e. no 'id' field). Therefore, when
file_id = self.metadata.get('id') or self.get('id')
is executed in the FetchMetadata function, file_id is None and FileNotUploadedError() is raised.

This error propagates into other functions that call FetchMetadata (e.g. GetPermissions()).

@shcheklein
Copy link
Collaborator

@7mt could you check if it is fixed in the PyDrive2 (a maintainer fork)?

@7mt
Copy link
Author

7mt commented Apr 27, 2021

Hi @shcheklein, just tested in PyDrive2 and I'm getting the same error.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants