rok commented on issue #33962: URL: https://github.com/apache/arrow/issues/33962#issuecomment-1859216766
@zanmato1984 you're welcome to tackle this! > Does it mean in C++, we can assume that it always binds to a `DurationType` with `TimeUnit::NANO`? Yes, `pandas.timedelta` appears to be always be `duration(TimeUnit::NANOSECOND)` as per your link (I did not check further). Although we might want to add component extraction for all possible duration units if we add it. C++ kernel logic would probably fit [here](https://github.com/apache/arrow/blob/main/cpp/src/arrow/compute/kernels/scalar_temporal_unary.cc) - you might be able to reuse other kernels and just add a `WithDurations` to register them for duration types. You can add [tests here](https://github.com/apache/arrow/blob/main/cpp/src/arrow/compute/kernels/scalar_temporal_test.cc). As for python side of things - you can just add a test like [this one](https://github.com/apache/arrow/blob/d9183643c86eccc7a620017e00333fb9d555fae0/python/pyarrow/tests/test_compute.py#L2228). -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
