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.
Cannot insert NaN and non-finite float values using Client.insert_rows() #696
Trying to insert a NaN using Client.insert_rows fails. I tracked it down to
def _float_to_json(value):
"""Coerce 'value' to an JSON-compatible representation."""
return value if value is None else float(value)
which should return "NaN" to be compatible with the REST API. Currently it returns an actual nan float value. Probably similar issues occur with other non-finite floats.
changed the title [-]Cannot insert NaN values using Client.insert_rows[/-][+]Cannot insert NaN and non-finite float values using Client.insert_rows()[/+]on Jun 29, 2021
Activity
wmdrichards commentedon Jun 11, 2021
For anyone else running into this, using
insert_rows_jsonis a valid workaround, as long as the row is already json-compatible[-]Cannot insert NaN values using Client.insert_rows[/-][+]Cannot insert NaN and non-finite float values using Client.insert_rows()[/+]plamut commentedon Jun 29, 2021
Thanks for reporting and researching that. It turned out that non-finite floats were indeed problematic, too.