According to BigQuery (BQ) API documentation, streaming insert (insertAll) input should be formed as
{"rows": [ {"insertId": "A String",
"json": {"a_key": ""},
},
],
}
(see https://developers.google.com/resources/api-libraries/documentation/bigquery/v2/python/latest/bigquery_v2.tabledata.html)
whereas in the example bigquery/api/streaming.py the input is formed differently as
insert_all_data = {
'insertId': str(uuid.uuid4()),
'rows': [{'json': row}]
}
The 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'
Reactions are currently unavailable
According to BigQuery (BQ) API documentation, streaming insert (insertAll) input should be formed as
{"rows": [ {"insertId": "A String",
"json": {"a_key": ""},
},
],
}
(see https://developers.google.com/resources/api-libraries/documentation/bigquery/v2/python/latest/bigquery_v2.tabledata.html)
whereas in the example bigquery/api/streaming.py the input is formed differently as
insert_all_data = {
'insertId': str(uuid.uuid4()),
'rows': [{'json': row}]
}
The 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'