json_data = '["xxxxxx",65465464.0,2,-1,10.10]'
Schema of bigquery table:
id STRING NULLABLE
timestamp STRING NULLABLE
xid INTEGER NULLABLE
yid INTEGER NULLABLE
magnitude FLOAT NULLABLE
script.py:
data = json.loads(json_data)
table.reload()
rows = [data]
errors = table.insert_data(rows)
Error:
errors = table.insert_data(rows)
File "/usr/local/lib/python2.7/dist-
packages/google/cloud/bigquery/table.py", line 749, in insert_data
value = _microseconds_from_datetime(value) * 1e-6
File "/usr/local/lib/python2.7/dist-packages/google/cloud/_helpers.py", line
363, in _microseconds_from_datetime
if not value.tzinfo:
AttributeError: 'float' object has no attribute 'tzinfo'
Does anyone has any idea about this error?
Appreciated!
datetime.datetime
object and you're passing a float. - fdsa