rok commented on issue #46301:
URL: https://github.com/apache/arrow/issues/46301#issuecomment-2852602897

   Indeed pyarrow curently considers year 0 as origin for rounding years: 
https://github.com/apache/arrow/blob/067fd2a2c6e54d33b9ae8a3324f59bebe960d485/cpp/src/arrow/compute/kernels/scalar_temporal_unary.cc#L1041-L1047
   If I remember correctly we have lubridate inspired `calendar_based_rounding`:
   
https://github.com/apache/arrow/blob/067fd2a2c6e54d33b9ae8a3324f59bebe960d485/cpp/src/arrow/compute/kernels/scalar_temporal_unary.cc#L752-L754
   And not `calendar_based_rounding`:
   
https://github.com/apache/arrow/blob/067fd2a2c6e54d33b9ae8a3324f59bebe960d485/cpp/src/arrow/compute/kernels/scalar_temporal_unary.cc#L798-L799
   Rounding to years in not `calendar_based_rounding` should then use 
1970-01-01 as origin indeed although one could argue it's bit of an exception. 
I'll open a PR.


-- 
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

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

Reply via email to