jorisvandenbossche commented on a change in pull request #7169:
URL: https://github.com/apache/arrow/pull/7169#discussion_r441567665



##########
File path: cpp/src/arrow/python/arrow_to_pandas.cc
##########
@@ -1688,8 +1698,12 @@ static Status GetPandasWriterType(const ChunkedArray& 
data, const PandasOptions&
       break;
     case Type::TIMESTAMP: {
       const auto& ts_type = checked_cast<const TimestampType&>(*data.type());
-      // XXX: Hack here for ARROW-7723
-      if (ts_type.timezone() != "" && !options.ignore_timezone) {
+      if (options.timestamp_as_object && ts_type.unit() != TimeUnit::NANO) {
+        // Nanoseconds are never out of bounds for pandas, so in that case

Review comment:
       In the code, I check here that the unit is *not* nanoseconds, because in 
that case we always preserve nanoseconds right now, regardless of the 
`timestamp_as_object` parameter. 
   So in case of nanosecons, this code path is not taken, and thus "we don't 
convert to object"
   
   I am happy to clarify the comment, if you have a suggestion or fix (in my 
turn, I don't understand where the extra negative clause would be .. ;-))




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to