HyukjinKwon commented on code in PR #48466:
URL: https://github.com/apache/arrow/pull/48466#discussion_r2666828836
##########
python/pyarrow/src/arrow/python/arrow_to_pandas.cc:
##########
@@ -1618,7 +1630,14 @@ class DatetimeMilliWriter : public
DatetimeWriter<TimeUnit::MILLI> {
// Convert from days since epoch to datetime64[ms]
ConvertDatetime<int32_t, 86400000L>(*data, out_values);
} else if (type == Type::DATE64) {
- ConvertNumericNullable<int64_t>(*data, kPandasTimestampNull, out_values);
+ // Date64Type is millisecond timestamp
+ if (this->options_.truncate_date64_time) {
+ // Truncate intraday milliseconds
+ ConvertDatetimeWithTruncation<1L>(*data, out_values);
Review Comment:
I believe it will optimize it out as a noop from my understanding but to
make sure, I changed a bit to leverage `constexpr` for 1 case. It should
compiletime branch it out, and should be optimized enough as documented in c++
lang.
--
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]