bigfunctions
bigfunctions copied to clipboard
[bug]: `upload_table_to_gsheet `: does not keep column ordered
Check the bug has not already been reported
- [X] I could not find the bug in existing issues
Edit function_name and the short error description in title above
- [X] I wrote the correct function name and a short error description in the title above
What happened and what did you expect?
Hi there,
I'm uploading a BQuery table to GSheet using upload_table_to_gsheet.
It does not But columns are ordered alphabetically.
Hi @armetiz.
Thanks a lot for opening this issue.
I had a look and could reproduce what you described.
After investigation, this is because:
- this procedure converts the table data into a json before sending it to
upload_to_gsheetfunction. - BigQuery json conversion reorders the fields alpabetically as seen in the following screenshot.
Then the only other way would be to generate a json string without passing by json and change upload_to_gsheet function signature to accept string instead of json as data.
Or maybe you have another suggestion?