We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
I have confirmed this bug exists on the main branch of pandas.
import pandas as pd import datetime as dt import sqlite3 df=pd.DataFrame({'t':[dt.datetime.now()]}, dtype='datetime64[ns]') conn=sqlite3.connect('test.sqlite3') df.to_sql('test', conn, if_exists='replace', index=False) conn.close()
With pandas version 2.1.0 the content of the sqlite3 table is:
SELECT * FROM test; 1693426580
So it stores datetime64[ns] as epoch.
With pandas version < 2.1.0 the content would be a string: 2023-08-30 22:16:24.753962
Save the datetime64[ns] as string like in the previous pandas versions
commit : ba1cccd python : 3.11.4.final.0 python-bits : 64 OS : Linux OS-release : 5.10.102.1-microsoft-standard-WSL2 Version : #1 SMP Wed Mar 2 00:30:59 UTC 2022 machine : x86_64 processor : x86_64 byteorder : little LC_ALL : None LANG : C.UTF-8 LOCALE : en_US.UTF-8
pandas : 2.1.0 numpy : 1.25.2 pytz : 2023.3 dateutil : 2.8.2 setuptools : 66.1.1 pip : 23.0.1 Cython : None pytest : None hypothesis : None sphinx : None blosc : None feather : None xlsxwriter : None lxml.etree : None html5lib : None pymysql : None psycopg2 : None jinja2 : None IPython : None pandas_datareader : None bs4 : None bottleneck : None dataframe-api-compat: None fastparquet : None fsspec : None gcsfs : None matplotlib : None numba : None numexpr : None odfpy : None openpyxl : None pandas_gbq : None pyarrow : None pyreadstat : None pyxlsb : None s3fs : None scipy : None sqlalchemy : None tables : None tabulate : None xarray : None xlrd : None zstandard : None tzdata : 2023.3 qtpy : None pyqt5 : None
The text was updated successfully, but these errors were encountered:
#53743 cc @lithomas1
Sorry, something went wrong.
pandas exclude version 2.1.0
eed180c
A regression breaks writing timestamps to GeoPackage for us: pandas-dev/pandas#54877
pandas exclude version 2.1.0 (#589)
8b63f25
A regression breaks writing timestamps to GeoPackage for us: pandas-dev/pandas#54877 Found in #586 (comment)
36b52ec
Successfully merging a pull request may close this issue.
Pandas version checks
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
Issue Description
With pandas version 2.1.0 the content of the sqlite3 table is:
SELECT * FROM test;
1693426580
So it stores datetime64[ns] as epoch.
With pandas version < 2.1.0 the content would be a string:
2023-08-30 22:16:24.753962
Expected Behavior
Save the datetime64[ns] as string like in the previous pandas versions
Installed Versions
INSTALLED VERSIONS
commit : ba1cccd
python : 3.11.4.final.0
python-bits : 64
OS : Linux
OS-release : 5.10.102.1-microsoft-standard-WSL2
Version : #1 SMP Wed Mar 2 00:30:59 UTC 2022
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : C.UTF-8
LOCALE : en_US.UTF-8
pandas : 2.1.0
numpy : 1.25.2
pytz : 2023.3
dateutil : 2.8.2
setuptools : 66.1.1
pip : 23.0.1
Cython : None
pytest : None
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : None
IPython : None
pandas_datareader : None
bs4 : None
bottleneck : None
dataframe-api-compat: None
fastparquet : None
fsspec : None
gcsfs : None
matplotlib : None
numba : None
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : None
pyreadstat : None
pyxlsb : None
s3fs : None
scipy : None
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
zstandard : None
tzdata : 2023.3
qtpy : None
pyqt5 : None
The text was updated successfully, but these errors were encountered: