Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 39de0c6

Browse filesBrowse files
author
Jerjou Cheng
committed
insertId is within the row, not the request.
Fixes bug GoogleCloudPlatform#134
1 parent 1ff6a5b commit 39de0c6
Copy full SHA for 39de0c6

File tree

Expand file treeCollapse file tree

1 file changed

+6
-4
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-4
lines changed

‎bigquery/api/streaming.py

Copy file name to clipboardExpand all lines: bigquery/api/streaming.py
+6-4Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,13 @@
3535
# [START stream_row_to_bigquery]
3636
def stream_row_to_bigquery(bigquery, project_id, dataset_id, table_name, row,
3737
num_retries=5):
38-
# Generate a unique row id so retries
39-
# don't accidentally duplicate insert
4038
insert_all_data = {
41-
'insertId': str(uuid.uuid4()),
42-
'rows': [{'json': row}]
39+
'rows': [{
40+
'json': row,
41+
# Generate a unique id for each row so retries don't accidentally
42+
# duplicate insert
43+
'insertId': str(uuid.uuid4()),
44+
}]
4345
}
4446
return bigquery.tabledata().insertAll(
4547
projectId=project_id,

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.