google-api-python-client icon indicating copy to clipboard operation
google-api-python-client copied to clipboard

Google Drive API v3: revisions().list lacking support for orderBy

Open danielgrittner opened this issue 1 year ago • 0 comments

Thanks for stopping by to let us know something could be better!

PLEASE READ: If you have a support contract with Google, please create an issue in the support console instead of filing on GitHub. This will ensure a timely response.

Please run down the following list and make sure you've tried the usual "quick fixes":

  • Search the issues already opened: https://github.com/googleapis/google-api-python-client/issues
  • Search StackOverflow: https://stackoverflow.com/questions/tagged/google-cloud-platform+python

If you are still having issues, please be sure to include as much information as possible:

Environment details

  • OS type and version: MacOSX 14.5
  • Python version: 3.12.6
  • pip version: 24.2
  • google-api-python-client version: 2.149.0

Steps to reproduce

  1. Build Google Drive service API v3
  2. Try to retrieve revisions of a file

Code example

drive_service = build("drive", "v3", credentials=creds)
request = drive_service.revisions().list(
    fileId=file_id,
    fields="nextPageToken, revisions(id, modifiedTime, lastModifyingUser, exportLinks)",
    orderBy="modifiedTime desc",
)

Stack trace

  File "/Users/danielgrittner/development/work/security_automation/another/admyral/admyral/actions/integrations/compliance/google_drive.py", line 91, in list_google_docs_revisions
    request = drive_service.revisions().list(
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/danielgrittner/development/work/security_automation/another/admyral/.venv/lib/python3.12/site-packages/googleapiclient/discovery.py", line 1101, in method
    raise TypeError("Got an unexpected keyword argument {}".format(name))
TypeError: Got an unexpected keyword argument orderBy

Making sure to follow these steps will guarantee the quickest resolution possible.

Thanks!

danielgrittner avatar Oct 11 '24 16:10 danielgrittner