Client.insert_rows throws exception when coercing string to float from release 2.21.0 #818
Labels
api: bigquery
Issues related to the googleapis/python-bigquery API.
priority: p2
Moderately-important priority. Fix may not be included in next release.
type: bug
Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
The behaviour of
Client.insert_rows
changed between release 2.20.0 and 2.21.0.In 2.20.0, where the schema defines a field to be of type
FLOAT
, a string passed in would be coerced to a float in the resulting JSON.In 2.21.0, where the schema defines a field to be of type
FLOAT
, a string passed in throws an exception.I've tracked this down to #728 , where a check is added for
isnan
orisinf
. However, those functions require a float to be provided so throw an exception if a string is provided. This check occurs before you get to the code that coerces the input to a float.Environment details
Python 3.6.10
pip 21.2.1
google-cloud-bigquery
version:2.22.1
Steps to reproduce
FLOAT
Client.insert_rows()
for that fieldCode example
Stack trace
The text was updated successfully, but these errors were encountered: