{"action":"closed","issue":{"url":"https://api.github.com/repos/GoogleCloudPlatform/python-docs-samples/issues/134","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/python-docs-samples/issues/134/labels{/name}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/python-docs-samples/issues/134/comments","events_url":"https://api.github.com/repos/GoogleCloudPlatform/python-docs-samples/issues/134/events","html_url":"https://github.com/GoogleCloudPlatform/python-docs-samples/issues/134","id":114028556,"number":134,"title":"BiqQuery Streaming Insert example is different from official documentation","user":{"login":"tsilochr","id":1014012,"avatar_url":"https://avatars.githubusercontent.com/u/1014012?v=3","gravatar_id":"","url":"https://api.github.com/users/tsilochr","html_url":"https://github.com/tsilochr","followers_url":"https://api.github.com/users/tsilochr/followers","following_url":"https://api.github.com/users/tsilochr/following{/other_user}","gists_url":"https://api.github.com/users/tsilochr/gists{/gist_id}","starred_url":"https://api.github.com/users/tsilochr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tsilochr/subscriptions","organizations_url":"https://api.github.com/users/tsilochr/orgs","repos_url":"https://api.github.com/users/tsilochr/repos","events_url":"https://api.github.com/users/tsilochr/events{/privacy}","received_events_url":"https://api.github.com/users/tsilochr/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"jerjou","id":913439,"avatar_url":"https://avatars.githubusercontent.com/u/913439?v=3","gravatar_id":"","url":"https://api.github.com/users/jerjou","html_url":"https://github.com/jerjou","followers_url":"https://api.github.com/users/jerjou/followers","following_url":"https://api.github.com/users/jerjou/following{/other_user}","gists_url":"https://api.github.com/users/jerjou/gists{/gist_id}","starred_url":"https://api.github.com/users/jerjou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jerjou/subscriptions","organizations_url":"https://api.github.com/users/jerjou/orgs","repos_url":"https://api.github.com/users/jerjou/repos","events_url":"https://api.github.com/users/jerjou/events{/privacy}","received_events_url":"https://api.github.com/users/jerjou/received_events","type":"User","site_admin":false},"milestone":null,"comments":2,"created_at":"2015-10-29T11:16:58Z","updated_at":"2015-10-30T15:56:18Z","closed_at":"2015-10-30T15:56:18Z","body":"According to BigQuery (BQ) API documentation, streaming insert (insertAll) input should be formed as \r\n{\"rows\": [ {\"insertId\": \"A String\",\r\n                 \"json\": {\"a_key\": \"\"},\r\n               },\r\n            ],\r\n}\r\n\r\n(see https://developers.google.com/resources/api-libraries/documentation/bigquery/v2/python/latest/bigquery_v2.tabledata.html)\r\n\r\nwhereas in the example  bigquery/api/streaming.py the input is formed differently as \r\n\r\ninsert_all_data = {\r\n        'insertId': str(uuid.uuid4()),\r\n        'rows': [{'json': row}]\r\n    }\r\n\r\nThe difference is where you place the 'insertId' key. A separate insertId should be with each row, not one 'insertId' at the same level with 'rows'"}}