unytics/bigfunctions

[bug]: `upload_table_to_gsheet `: does not keep column ordered

armetiz opened this issue · 1 comments

Check the bug has not already been reported

Edit function_name and the short error description in title above

  • 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_gsheet function.
  • BigQuery json conversion reorders the fields alpabetically as seen in the following screenshot.

image

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?