nithinmurali / pygsheets

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

fix: google sheet creation when folder id is provided #571

Closed colwynlegitscript closed 1 year ago

colwynlegitscript commented 1 year ago

Fixes https://github.com/nithinmurali/pygsheets/issues/562 for my usage. I'm not sure if there are more use cases that need to be covered here or other places where the same self.drive.spreadsheet_metadata(fid=result['spreadsheetId']) call is made that need to be modified.

Please let me know if you want me to look for more places where this might be an issue or add a test for this particular breakage. I can look into it.

nithinmurali commented 1 year ago

@colwynlegitscript Thank you for the MR. Can you please add a test for this here? you can use the create_folder call for this.

This was introduced in https://github.com/nithinmurali/pygsheets/commit/59cb8ef8b435e873aeca8bcff1644d01ad1d2629 where we change from query to fid. So this is a valid fix and no other corner cases should be there.

colwynlegitscript commented 1 year ago

Alright, I added a test for this particular case. It passes on this branch and fails on staging.