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

Deleting only rows #4

Open
jurasofish opened this issue Mar 18, 2020 · 0 comments
Open

Deleting only rows #4

jurasofish opened this issue Mar 18, 2020 · 0 comments

Comments

@jurasofish
Copy link

jurasofish commented Mar 18, 2020

Is it possible to delete only rows and not any columns? Looking at the code it appears to assume the deleteColumns key is present. Would be super easy to modify, hmu if you want a pull request.

resource = {
    "oauth2": creds,
    "documentId": copy_id,
    "tableIndex": 0,
    "deleteRows": [3],
    "deleteColumns": []
}
res = gdoctableapp.DeleteRowsAndColumns(resource)
print(res)  # You can see the retrieved responses from Docs API.

Traceback (most recent call last):
  File "/Applications/PyCharm CE.app/Contents/helpers/pydev/_pydevd_bundle/pydevd_exec2.py", line 3, in Exec
    exec(exp, global_vars, local_vars)
  File "<string>", line 8, in <module>
  File "/opt/miniconda3/envs/templating/lib/python3.7/site-packages/gdoctableapppy/gdoctableapp.py", line 38, in DeleteRowsAndColumns
    return gdoctableapp(resource).deleteRowsAndColumns()
  File "/opt/miniconda3/envs/templating/lib/python3.7/site-packages/gdoctableapppy/gdoctableapp.py", line 728, in deleteRowsAndColumns
    self.__deleteRowsAndColumnsMain()
  File "/opt/miniconda3/envs/templating/lib/python3.7/site-packages/gdoctableapppy/gdoctableapp.py", line 356, in __deleteRowsAndColumnsMain
    maxDeleteCols = max(self.obj["params"]["deleteColumns"]) + 1
ValueError: max() arg is an empty sequence
resource = {
    "oauth2": creds,
    "documentId": copy_id,
    "tableIndex": 0,
    "deleteRows": [3]
}
res = gdoctableapp.DeleteRowsAndColumns(resource)
print(res)  # You can see the retrieved responses from Docs API.

Traceback (most recent call last):
  File "/Applications/PyCharm CE.app/Contents/helpers/pydev/_pydevd_bundle/pydevd_exec2.py", line 3, in Exec
    exec(exp, global_vars, local_vars)
  File "<string>", line 7, in <module>
  File "/opt/miniconda3/envs/templating/lib/python3.7/site-packages/gdoctableapppy/gdoctableapp.py", line 38, in DeleteRowsAndColumns
    return gdoctableapp(resource).deleteRowsAndColumns()
  File "/opt/miniconda3/envs/templating/lib/python3.7/site-packages/gdoctableapppy/gdoctableapp.py", line 728, in deleteRowsAndColumns
    self.__deleteRowsAndColumnsMain()
  File "/opt/miniconda3/envs/templating/lib/python3.7/site-packages/gdoctableapppy/gdoctableapp.py", line 356, in __deleteRowsAndColumnsMain
    maxDeleteCols = max(self.obj["params"]["deleteColumns"]) + 1
KeyError: 'deleteColumns'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant