Closed
Description
Traceback (most recent call last):
File "/tmp/test-bq_20210416_36390b15/test_bq.py", line 8, in <module>
df.to_gbq(
File "/opt/conda/default/lib/python3.8/site-packages/pandas/core/frame.py", line 1710, in to_gbq
gbq.to_gbq(
File "/opt/conda/default/lib/python3.8/site-packages/pandas/io/gbq.py", line 211, in to_gbq
pandas_gbq.to_gbq(
File "/opt/conda/default/lib/python3.8/site-packages/pandas_gbq/gbq.py", line 1093, in to_gbq
connector.load_data(
File "/opt/conda/default/lib/python3.8/site-packages/pandas_gbq/gbq.py", line 580, in load_data
self.process_http_error(ex)
File "/opt/conda/default/lib/python3.8/site-packages/pandas_gbq/gbq.py", line 380, in process_http_error
raise GenericGBQException("Reason: {0}".format(ex))
pandas_gbq.gbq.GenericGBQException: Reason: 400 Error while reading data, error message: Could not parse '2021-04-17 00:00:00.000000' as DATE for field for_date (position 1) starting at location 0 with message 'Unable to parse'
I seem to be able to work around this by forcing the datetime64[ns] column to the .dt.date of the datetime64, but it seems like pandas-gbq should be able to figure this out when I supply the schema with a 'DATE' column in it.