You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2020/06/10 15:51:06 UTC

[GitHub] [arrow] itamarst commented on pull request #7169: ARROW-5359: [Python] Support non-nanosecond out-of-range timestamps in conversion to pandas

itamarst commented on pull request #7169:
URL: https://github.com/apache/arrow/pull/7169#issuecomment-642098139


   > @itamarst thanks for the updated tests
   > 
   > I wanted to do a final check before merging, but I now realize we might not necessarily need a new option on the C++ level (`timestamp_as_object`), as we already have the internal `coerce_temporal_nanoseconds` option, which we can set depending on the public `timestamp_as_object` option.
   > 
   > Eg the code at
   > 
   > https://github.com/apache/arrow/blob/75546d1aa8a45a0358f88f4993a5a8ed2452f2e4/python/pyarrow/array.pxi#L1114-L1115
   > 
   > could be (I think)
   > 
   > ```
   > if not timestamp_as_object:
   >     c_options.coerce_temporal_nanoseconds = True
   > ```
   > 
   
   Mmmm. Maybe? That also interacts with `date_as_object` so it plausibly will have side-effects if we switch to that implmenetation.
   
   ```c++
       case Type::DATE64:
         if (options.date_as_object) {
           *output_type = PandasWriter::OBJECT;
         } else {
           *output_type = options.coerce_temporal_nanoseconds ? PandasWriter::DATETIME_NANO
                                                              : PandasWriter::DATETIME_DAY;
         }
   
   ```
   


----------------------------------------------------------------
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:
users@infra.apache.org