nithinmurali / pygsheets

Google Sheets Python API v4
https://pygsheets.readthedocs.io/en/latest
Other
1.51k stars 220 forks source link

`set_dataframe` function reached cell limit #589

Open linglp opened 12 months ago

linglp commented 12 months ago

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

dependencies


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