BUG: to_parquet
set schema metadata to datetime64
instead of datetime64[us]
when dtype of the column is datetime64[us]
#55118
Labels
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
to_parquet
generate incorrect schema metadata when using datetime64[us] as column dtype. As a result,read_parquet
raiseTypeError
.copy from
pyarrow
bypq.read_schema('t.parquet').metadata
Expected Behavior
pandas_type
should bedatetime64[us]
notdatetime64
in the schema metadataInstalled Versions
INSTALLED VERSIONS
commit : ba1cccd
python : 3.10.10.final.0
python-bits : 64
OS : Linux
OS-release : 5.4.0-153-generic
Version : #170-Ubuntu SMP Fri Jun 16 13:43:31 UTC 2023
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : en_US.UTF-8
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8
pandas : 2.1.0
numpy : 1.25.2
pytz : 2023.3.post1
dateutil : 2.8.2
setuptools : 65.5.0
pip : 23.2.1
Cython : 3.0.0
pytest : 7.4.2
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : 4.9.3
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 3.1.2
IPython : 8.15.0
pandas_datareader : 0.10.0
bs4 : 4.12.2
bottleneck : None
dataframe-api-compat: None
fastparquet : None
fsspec : 2023.6.0
gcsfs : None
matplotlib : 3.7.2
numba : None
numexpr : 2.8.6
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : 13.0.0
pyreadstat : None
pyxlsb : None
s3fs : None
scipy : 1.11.2
sqlalchemy : 2.0.18
tables : 3.8.0
tabulate : 0.9.0
xarray : 2023.7.0
xlrd : None
zstandard : None
tzdata : 2023.3
qtpy : None
pyqt5 : None
The text was updated successfully, but these errors were encountered: