to_sql Out of bounds nanosecond timestamp · Issue #26761 · pandas-dev/pandas (original) (raw)
Code Sample, a copy-pastable example if possible
Your code here
df.to_sql(TableName,index=False,if_exists="replace")
Problem description
I upgraded my pandas to 0.24.2 recently and encountered below error, which will not pop before.
When I am using python to transfer some data to sql server. Some date is set to 9999-12-31 and it will cause error: OutOfBoundsDatetime: Out of bounds nanosecond timestamp: 9999-12-31 00:00:00
Expected Output
We should be able to transfer those date. Thanks
Output of pd.show_versions()
[paste the output of pd.show_versions()
here below this line]
INSTALLED VERSIONS
commit: None
python: 3.7.0.final.0
python-bits: 64
OS: Windows
OS-release: 10
machine: AMD64
processor: Intel64 Family 6 Model 69 Stepping 1, GenuineIntel
byteorder: little
LC_ALL: None
LANG: None
LOCALE: None.None
pandas: 0.24.2
pytest: 3.8.0
pip: 19.0.2
setuptools: 40.2.0
Cython: 0.28.5
numpy: 1.16.2
scipy: 1.1.0
pyarrow: None
xarray: None
IPython: 6.5.0
sphinx: 1.7.9
patsy: 0.5.0
dateutil: 2.7.3
pytz: 2018.5
blosc: None
bottleneck: 1.2.1
tables: 3.4.4
numexpr: 2.6.8
feather: None
matplotlib: 2.2.3
openpyxl: 2.5.6
xlrd: 1.1.0
xlwt: 1.3.0
xlsxwriter: 1.1.0
lxml.etree: 4.2.5
bs4: 4.6.3
html5lib: 1.0.1
sqlalchemy: 1.2.11
pymysql: None
psycopg2: None
jinja2: 2.10
s3fs: None
fastparquet: None
pandas_gbq: None
pandas_datareader: None
gcsfs: None