Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'alt' Parameter Does Not Work in 'files().get()' #2196

Open
Scemist opened this issue Jul 20, 2023 · 0 comments
Open

'alt' Parameter Does Not Work in 'files().get()' #2196

Scemist opened this issue Jul 20, 2023 · 0 comments
Assignees
Labels
api: drive Issues related to the Drive API API. status: investigating The issue is under investigation, which is determined to be non-trivial.

Comments

@Scemist
Copy link

Scemist commented Jul 20, 2023

The alt option does not work on files().get(): alt as [json, media or proto] always returns the json metadata format.

There is no error, but it ignores the parameter.

Environment details

  • Alpine Linux 3.18.2
  • Python 3.11.4
  • Pip 23.1.2
  • google-api-python-client 2.94.0

Steps to reproduce

  1. Normally Use the Library;
  2. After successfully auth and get the file id;
  3. Use any of the following lines of code to get the file content:

Code example

If You Pass Whatever Accepted Option, The Reponse is Always the Metadata

file = drive.files().get(alt="media", fileId=id).execute()
file = drive.files().get(alt="proto", fileId=id).execute()
file = drive.files().get(alt="json", fileId=id).execute()

The response:

{
  "id": "dfjjh1394hf1eijdhf1s",
  "kind": "drive#file",
  "mimeType": "text/plain",
  "name": "Filename"
}

But if You Try a Wrong Option, It Throws the Error as It Should

 file = drive.files().get(alt="nonexistante", fileId=id).execute()

The Error:

TypeError: Parameter "alt" value "nonexistante" is not an allowed value in "['json', 'media', 'proto']"
@parthea parthea self-assigned this Jul 24, 2023
@parthea parthea added status: investigating The issue is under investigation, which is determined to be non-trivial. api: drive Issues related to the Drive API API. labels Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: drive Issues related to the Drive API API. status: investigating The issue is under investigation, which is determined to be non-trivial.
Projects
None yet
Development

No branches or pull requests

2 participants