Skip to content
New issue

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

BUG: datetime64[s] fails round trip using .to_parquet and read_parquet #61165

Closed
3 tasks done
noahblakesmith opened this issue Mar 21, 2025 · 1 comment
Closed
3 tasks done
Labels
Bug Datetime Datetime data dtype IO Parquet parquet, feather

Comments

@noahblakesmith
Copy link

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

import pandas as pd

c = pd.Series(["2024-01-01", "2025-01-01", "2026-01-01"], dtype="datetime64[s]")
df0 = c.to_frame()

print(df0.dtypes)
df0.to_parquet("test.parquet")

df1 = pd.read_parquet("test.parquet")
print(df1.dtypes)

Issue Description

The dtype changes from datetime64[s] to datetime64[ms].

Expected Behavior

I would expect the dtype to remain unchanged.

Installed Versions

INSTALLED VERSIONS

commit : 0691c5c
python : 3.10.16
python-bits : 64
OS : Linux
OS-release : 6.8.0-1021-azure
Version : #25-Ubuntu SMP Wed Jan 15 20:45:09 UTC 2025
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : C.UTF-8
LOCALE : en_US.UTF-8

pandas : 2.2.3
numpy : 2.2.2
pytz : 2025.1
dateutil : 2.9.0.post0
pip : 25.0
Cython : None
sphinx : None
IPython : 8.34.0
adbc-driver-postgresql: None
adbc-driver-sqlite : None
bs4 : 4.13.3
blosc : None
bottleneck : None
dataframe-api-compat : None
fastparquet : None
fsspec : 2025.3.0
html5lib : None
hypothesis : None
gcsfs : None
jinja2 : 3.1.6
lxml.etree : 5.3.1
matplotlib : None
numba : None
numexpr : None
odfpy : None
openpyxl : 3.1.5
pandas_gbq : None
psycopg2 : None
pymysql : None
pyarrow : 19.0.1
pyreadstat : None
pytest : None
python-calamine : None
pyxlsb : None
s3fs : None
scipy : None
sqlalchemy : 2.0.39
tables : None
tabulate : None
xarray : None
xlrd : 2.0.1
xlsxwriter : None
zstandard : None
tzdata : 2025.1
qtpy : None
pyqt5

@noahblakesmith noahblakesmith added Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Mar 21, 2025
@rhshadrach
Copy link
Member

Closing as a duplicate of #60774.

@rhshadrach rhshadrach added Datetime Datetime data dtype IO Parquet parquet, feather and removed Needs Triage Issue that has not been reviewed by a pandas team member labels Mar 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Datetime Datetime data dtype IO Parquet parquet, feather
Projects
None yet
Development

No branches or pull requests

2 participants