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]: parquet containing ConvertedType TIMESTAMP_MILLIS may throw IndexOutOfRangeException while reading. #542

Closed
artnim opened this issue Aug 21, 2024 · 1 comment

Comments

@artnim
Copy link
Contributor

artnim commented Aug 21, 2024

Library Version

4.24.0

OS

Ubuntu Linux

OS Architecture

64 bit

How to reproduce?

  1. Create a parquet with timeseries as datetime64[ms]
import pandas as pd

pd.set_option('io.parquet.engine', 'fastparquet')

start_time = pd.Timestamp('2024-08-21T00:00:00+02:00')
end_time = pd.Timestamp('2024-08-22T00:00:00+02:00')
series = pd.date_range(start_time, end_time, freq=pd.Timedelta(minutes=15))[:-1]

series = series.tz_convert('UTC').tz_localize(None).astype("datetime64[ms]")

df = pd.DataFrame({'datetime': series})

print(df)
print(df.dtypes)

df.to_parquet('./test.parquet')
  1. Open the resulting test.parquet using floor
    image

The same works like a charm reading a parquet with created with the library. So I suggest a dependency with the fastparquet engine used my site.

Failing test

No response

@artnim
Copy link
Contributor Author

artnim commented Aug 23, 2024

Meanwhile, I can confirm that the problem is caused by what fastparquet writes. The problem does not exist with pyarrow.

@artnim artnim closed this as completed Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant