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

bigquery: retry Client.create_rows #4178

Merged
merged 1 commit into from
Oct 13, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions bigquery/google/cloud/bigquery/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -902,7 +902,7 @@ def query(self, query, job_config=None, job_id=None, retry=DEFAULT_RETRY):

def create_rows(self, table, rows, row_ids=None, selected_fields=None,
skip_invalid_rows=None, ignore_unknown_values=None,
template_suffix=None):
template_suffix=None, retry=DEFAULT_RETRY):
"""API call: insert table data via a POST request

See
Expand Down Expand Up @@ -954,6 +954,9 @@ def create_rows(self, table, rows, row_ids=None, selected_fields=None,
on the schema of the template table. See
https://cloud.google.com/bigquery/streaming-data-into-bigquery#template-tables

:type retry: :class:`google.api.core.retry.Retry`
:param retry: (Optional) How to retry the RPC.

:rtype: list of mappings
:returns: One mapping per row with insert errors: the "index" key
identifies the row, and the "errors" key contains a list
Expand Down Expand Up @@ -1002,8 +1005,9 @@ def create_rows(self, table, rows, row_ids=None, selected_fields=None,
if template_suffix is not None:
data['templateSuffix'] = template_suffix

# TODO(jba): use self._call_api here after #4148 is merged.
response = self._connection.api_request(
# We can always retry, because every row has an insert ID.
response = self._call_api(
retry,
method='POST',
path='%s/insertAll' % table.path,
data=data)
Expand Down