Skip to content

Conversation

@jmgreger
Copy link

Adding information to this example for more efficient streaming. Reduce calls to client.get_table()

This PR is meant to replace #212 due to issues from referencing a release initially. Comments and suggestions were incorporated into this PR.

Fixes #211 🦕

Adding information to this example for more efficient streaming. Reduce calls to client.get_table()
@jmgreger jmgreger requested review from a team and shollyman as code owners August 31, 2020 16:54
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Aug 31, 2020
@jmgreger jmgreger requested review from dinagraves and removed request for a team August 31, 2020 16:54
@product-auto-label product-auto-label bot added the api: bigquery Issues related to the googleapis/python-bigquery API. label Sep 1, 2020
Copy link
Contributor

@plamut plamut left a comment

Choose a reason for hiding this comment

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

On the surface the change seems sensible, although I cannot really comment on the wording in the comments, as I'm not a native English speaker.

Before merging, though, please make sure that the all the checks pass (linters, tests...), and that commit messages follow the conventional commits guideline, thanks!

if errors == []:
try:
# Stream data to BQ
client.insert_rows(table_id, selected_fields=schema, rows_to_insert)
Copy link
Contributor

Choose a reason for hiding this comment

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

Positional arguments cannot follow keyword arguments, please change the call.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, still need to check for errors. The API call returns success on parial failure, such as unable to insert a particular row.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: bigquery Issues related to the googleapis/python-bigquery API. cla: yes This human has signed the Contributor License Agreement.

3 participants