read_gbq() raises AttributeError for TIMESTAMP values out of bounds for pd.Timestamp #468
Labels
api: bigquery
Issues related to the googleapis/python-bigquery-pandas 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.
It appears that
pandas-gbq
does not appropriate handleTIMESTAMP
values that are out of the range of whatpd.Timestamp
can support. As a result, any query that contains aTIMESTAMP
column with a value outside of the supported range will raise anAttributeError
.Environment details
Darwin Kernel Version 20.6.0: Mon Aug 30 06:12:20 PDT 2021; root:xnu-7195.141.6~3/RELEASE_ARM64_T8101
Python 3.7.11
pip 21.2.4 from /usr/local/lib/python3.7/site-packages/pip (python 3.7)
pandas-gbq
version:Steps to reproduce
TIMESTAMP
with a date earlier thanpd.Timestamp.min
.pandas_gbq.read_gbq()
with that SQL query.Code example
Stack trace
Expected result
pd.read_sql()
handles out-of-bounds timestamps gracefully by reverting to theobject
dtype:I would expect
pandas-gbq
to have the same behaviour.The text was updated successfully, but these errors were encountered: