You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 6, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Mar 6, 2026. It is now read-only.
Client.insert_rows_json(): add option to disable best-effort deduplication #720
Currently, the Client.insert_rows_json() method for streaming inserts always inserts an insertId unique identifier for each row provided.
This row identifier can be user-provided; if the user doesn't provide any identifiers, the library automatically fills the row IDs by using UUID4.
However, insert IDs are entirely optional, and there are actually valid use cases not to use them. From the BigQuery documentation:
You can disable best effort de-duplication by not populating the insertId field for each row inserted. When you do not populate insertId, you get higher streaming ingest quotas in certain regions. This is the recommended way to get higher streaming ingest quota limits.
The BigQuery Python client library provides no way of omitting the insertIds. it would be nice to have a parameter for that.
Activity
plamut commentedon Jun 28, 2021
I'll double check why this is the case, but at a glance this request sounds reasonable. 👍
tswast commentedon Jun 28, 2021
I recall that you can explicitly pass in a list of
Nonevalues to omit these.It might be useful to have a more discoverable way to do this, though.
pietrodn commentedon Jun 29, 2021
It seems to work. However I don't see the point in allocating memory just to generate a list of
Nones, maybe it can be improved? :-)plamut commentedon Jun 29, 2021
A memory efficient alternative would be to provide a fake sequence-ish object that returns
Nonefor every index:A bit hacky, but should be a good enough workaround until more user friendly support is added. :)
plamut commentedon Jun 29, 2021
Update: This was confirmed, we'll add support for this in a more user-friendly way.
pietrodn commentedon Jul 1, 2021
Amazing, thanks!