-
Notifications
You must be signed in to change notification settings - Fork 934
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
Added a range option to Worksheet.get_notes
[Issue #1482]
#1487
base: master
Are you sure you want to change the base?
Conversation
hi! thanks for the change! your code was all good, but the test cassette was breaking things. This is common, and what I usually do is completely delete the JSON test cassette and re-create it, effectively running: rm tests\cassettes\WorksheetTest.test_get_notes.json
GS_CREDS_FILENAME="tests/creds.json"
GS_RECORD_MODE="all"
pytest -k "test_get_notes" -v -s tests/
# check it worked
GS_RECORD_MODE="none"
pytest -k "test_get_notes" -v -s tests/ I have reformatted the test a little so it is easier to read for me, and changed Also, in testing, I noticed that again thanks for the change! I will let @lavigne958 read this and merge when happy with it :) |
Wait is that wrong? For example, there are three worksheets (Sheet1, Sheet2, Sheet3).
If you change |
… test) now we can index the 0th sheet as we know that only one sheet will ever be returned (sheet titles are unique)
As it turns out... yes and no! ;] When you provide a range, i.e., here Then the returned results has only one sheet. Printing > get_notes()
# res =
{'sheets':
[
{'data': [{}]},
{'data': [{'rowData': [{'values': [{'note': 'the first time'}]}, {}, {'values': [{}, {'note': 'two sheets'}]}]}]}
]
}
> get_notes("A2:C3")
# res =
{'sheets':
[
{'data': [{'rowData': [{}, {'values': [{}, {'note': 'two sheets'}]}]}]}
]
} So in the initial case, we do need to index it with In the second case, we need to use I have made the test clearer (split it out) and 'fixed' it by always providing Thanks for spotting @nbwzx ! :) |
Worksheet.get_range
[Issue #1482]Worksheet.get_notes
[Issue #1482]
sorry for jumping on your PR @muddi900. wouldn't have happened without you ;] so thanks for proposing the change! will let @lavigne958 review and with an approval I will merge, and this can be included in 6.2.0 :) |
Fixes #1482