kylebarron opened a new issue, #7173:
URL: https://github.com/apache/arrow-rs/issues/7173

   **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](https://github.com/kylebarron/arro3/blob/d2eb765ddb88f47a33ad8ab487d2bc5aca7e597d/pyo3-arrow/src/scalar.rs#L196-L199).
   
   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`](https://github.com/PyO3/pyo3/pull/4790).
   
   One way to fix this is to converting all time zones to a fixed offset 
manually, e.g. 
   
   ```rs
   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: 
https://github.com/apache/arrow-rs/blob/a0c3186c55ac8ed3f6b8a15d1305548fd6305ebb/arrow-array/src/timezone.rs#L81-L85
   
   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**
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscr...@arrow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to