[X] I have checked that this issue has not already been reported.
[X] I have confirmed this bug exists on the latest version of Polars.
Issue description
This is running into weird edge-case territory, but if you use polars to create a date that surpasses datetime.date's limits, we get a panic when trying to retrieve the underlying date.
Reproducible example
from datetime import date
import polars as pl
# create a series that's 1 day more than datetime.date can handle. Polars does fine with it.
s = pl.Series([date(9999, 12, 31)]).dt.offset_by("1d")
# panic here:
s.item()
pyo3_runtime.PanicException: called `Result::unwrap()` on an `Err` value: PyErr { type: <class 'OverflowError'>,
value: OverflowError('date value out of range'), traceback: Some(<traceback object at 0x00000205D798AF40>) }
Polars version checks
[X] I have checked that this issue has not already been reported.
[X] I have confirmed this bug exists on the latest version of Polars.
Issue description
This is running into weird edge-case territory, but if you use polars to create a date that surpasses
datetime.date
's limits, we get a panic when trying to retrieve the underlying date.Reproducible example
Expected behavior
Should raise error or not allow this behavior.
Installed versions