You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "xhochy (via GitHub)" <gi...@apache.org> on 2025/10/15 07:12:10 UTC

Re: [I] [C++][Python] `cast` with timezone-aware array inconsistent when casting to `timestamp` and `date32` [arrow]

xhochy commented on issue #46738:
URL: https://github.com/apache/arrow/issues/46738#issuecomment-3404908463

   The relevant section in the standard should be https://github.com/apache/arrow/blob/7b8e3e88f6e87437e821ccf15c3ff6f60a8d0ae1/format/Schema.fbs#L277. From reading that, I would infer that `print(pc.strftime(arr.cast(pa.date32()), '%Y-%m-%d'))` is correct, i.e. the local timezone should be used.
   
   But, looking at https://github.com/apache/arrow/blob/7b8e3e88f6e87437e821ccf15c3ff6f60a8d0ae1/format/Schema.fbs#L327, it also seems that the `timestamp` case is correct. This seems quite counterintuitive to me, but the cast here seems to work as a "reinterpret" instead of actually updating the underlying values.


-- 
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-unsubscribe@arrow.apache.org

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