Skip to content

Support ignoreUnknownValues and skipInvalidRows option for insertAll #90

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

Merged
merged 2 commits into from
Apr 18, 2016

Conversation

hagino3000
Copy link
Contributor

Now BigQuery support ignoreUnknownValues and skipInvalidRows option for InsertAll.
https://cloud.google.com/bigquery/docs/reference/v2/tabledata/insertAll

I added two options to push_rows method.

@@ -1137,7 +1137,8 @@ def wait_for_job(self, job, interval=5, timeout=60):

return job_resource

def push_rows(self, dataset, table, rows, insert_id_key=None):
def push_rows(self, dataset, table, rows, insert_id_key=None,
skip_invalid_rows=None, ignore_unknown_values=None):
Copy link
Owner

Choose a reason for hiding this comment

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

Any reason you default these to None rather than False?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

To keep current behavior. Current behavior neither send True nor send False.

@tylertreat
Copy link
Owner

Minor comment, otherwise LGTM. Is this still a WIP?

@tylertreat
Copy link
Owner

Also, maybe want to include the new options in a unit test.

@hagino3000 hagino3000 changed the title [WIP]Support ignoreUnknownValues and skipInvalidRows option for insertAll Support ignoreUnknownValues and skipInvalidRows option for insertAll Apr 18, 2016
@hagino3000
Copy link
Contributor Author

@tylertreat Thanks. I added unit tests and checked actual result of push_rows method to my BigQuery table.

@tylertreat
Copy link
Owner

Thanks!

@tylertreat tylertreat merged commit 2b43879 into tylertreat:master Apr 18, 2016
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