[FIX] run_batch with requests from multiple spreadsheets#582
[FIX] run_batch with requests from multiple spreadsheets#582Sevans711 wants to merge 2 commits intonithinmurali:stagingfrom
Conversation
|
Thank you for the PR! please add a test to verify if its all good. |
|
Okay, I did this renaming: Can you help me with "add a test to verify if it's all good"? I'm relatively new at contributing to other repositories. Also, thank you for building/maintaining pygsheets! |
|
So we need to add some tests to verify that the functionality that you added works as intended. For pygsheets we only have tests that use the real API (end to end tests). You can find them here. For this PR you can write a test that makes some batch requests in multiple sheets that would have failed with the old code but with this fix its fixed. Please refer to existing examples on how to write tests (you can also find examples in old PRs #571 ) |
Previously, run_batch behavior was not correct (or at least, not intuitive - there was a
returnstatement direcly inside aforloop).Previous behavior:
batched_requestsself.batched_requestsNew behavior:
batched_requests(one spreadsheet at a time)self.batched_requests = dict()result= list of replies, with length equal to number of spreadsheets. For backwards compatibility, when there is only one spreadsheet the default behavior is to returnresult[0]instead.