Skip to content

set_dataframe function reached cell limit #589

@linglp

Description

@linglp

Note, if this is a usage question, please ask a question in stackoverflow with pygsheets tag.

Describe the bug
set_dataframe seems to have the limit of 1,000,000 cells, but Google API limit is 10,000,000 cells (see documentation here)

To Reproduce
Steps to reproduce the behavior:

gc = ps.authorize(custom_credentials='mock creds')
sh = gc.create('my google sheet')
wks = sh[0]
mock_manifest_df = pd.DataFrame(index=np.arange(1000000), columns=np.arange(1))
wks.set_dataframe(mock_manifest_df, (1, 1), fit=True)
# see error
  File "/Users/lpeng/Library/Caches/pypoetry/virtualenvs/schematicpy-9OomxyhV-py3.10/lib/python3.10/site-packages/googleapiclient/http.py", line 938, in execute
    raise HttpError(resp, content, uri=self.uri)
googleapiclient.errors.HttpError: <HttpError 400 when requesting https://sheets.googleapis.com/v4/spreadsheets/1n8CLrthzK3SHSU74Ud3E_Rgq6KfzJSJBVoesM8UM8qQ:batchUpdate?fields=%2A&alt=json returned "Invalid requests[0].updateSheetProperties: This action would increase the number of cells in the workbook above the limit of 10000000 cells.". Details: "Invalid requests[0].updateSheetProperties: This action would increase the number of cells in the workbook above the limit of 10000000 cells.">

System Information

  • OS: [e.g. iOS]
  • pygsheets version :
 name         : pygsheets                         
 version      : 2.0.6                             
 description  : Google Spreadsheets Python API v4 

dependencies
 - google-api-python-client >=2.50.0
 - google-auth-oauthlib >=0.7.1

  • pygsheets installed from (github or pypi): installed by using poetry add

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions