move-coop / parsons

A python library of connectors for the progressive community.
Other
254 stars 125 forks source link

Bug fix: pass custom delimiter from Table.from_csv to BigQuery load #1083

Open austinweisgrau opened 1 week ago

austinweisgrau commented 1 week ago

A bug was introduced by recent PR #1062

If our source table is loaded from CSV with no transformations, the original source file will be directly loaded to GCS.

We may need to pass along a custom delimiter to BigQuery.

e.g. for this workflow:

tbl = Table.from_csv(filepath, delimiter='\t')
BigQuery().copy(tbl, 'my_dataset.my_table')

The copy job will fail because the delimiter for the file loaded to GCS will be a \t, but BigQuery().copy() expects a comma by default.

This change fixes that to pass along any custom delimiter set on the Table file load to the BigQuery copy job config.