Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Aug 27, 2024

Conversation

austinweisgrau
Copy link
Collaborator

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.

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.
Copy link
Collaborator

@shaunagm shaunagm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me, although I'm not a BigQuery user so my ability to review here is limited. (Or delimited? 🥁)

@shaunagm shaunagm merged commit c692a1c into move-coop:main Aug 27, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants