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

Shared Drive Metadata Fetch Unsupported #228

@7mt

Description

@7mt

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()).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions