Is your feature request related to a problem or challenge? Please describe what you are trying to do.
In pyo3-arrow, I'm converting from Arrow scalars to Python objects.
Prior to pyo3 0.23.4, pyo3 handled the object conversion by converting all time zones to a fixed offset, but as of pyo3 0.23.4, pyo3 requires the Tz implementation to implement IntoPyObject, and arrow_array::timezone::Tz does not.
One way to fix this is to converting all time zones to a fixed offset manually, e.g.
let dt: chrono::DateTime<arrow_array::timezone::Tz> = ...;
dt.fixed_offset().into_py_any(py)?
But this loses timezone information. It would be ideal to convert all timezone information into the Python scalar. But TzInner is private:
|
#[derive(Debug, Copy, Clone)] |
|
enum TzInner { |
|
Timezone(chrono_tz::Tz), |
|
Offset(FixedOffset), |
|
} |
So we have no way to access the underlying chrono_tz::Tz out of the Tz.
Describe the solution you'd like
Make TzInner public.
Describe alternatives you've considered
Always convert to a fixed offset, but this will lose any timezone information.
Additional context
Is your feature request related to a problem or challenge? Please describe what you are trying to do.
In pyo3-arrow, I'm converting from Arrow scalars to Python objects.
Prior to pyo3 0.23.4, pyo3 handled the object conversion by converting all time zones to a fixed offset, but as of pyo3 0.23.4, pyo3 requires the
Tzimplementation to implementIntoPyObject, andarrow_array::timezone::Tzdoes not.One way to fix this is to converting all time zones to a fixed offset manually, e.g.
But this loses timezone information. It would be ideal to convert all timezone information into the Python scalar. But TzInner is private:
arrow-rs/arrow-array/src/timezone.rs
Lines 81 to 85 in a0c3186
So we have no way to access the underlying
chrono_tz::Tzout of theTz.Describe the solution you'd like
Make
TzInnerpublic.Describe alternatives you've considered
Always convert to a fixed offset, but this will lose any timezone information.
Additional context