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 2021/07/20 16:46:06 UTC

[GitHub] [arrow] kszucs commented on a change in pull request #10575: ARROW-13086: [Python] Expose Parquet ArrowReaderProperties::coerce_int96_timestamp_unit_

kszucs commented on a change in pull request #10575:
URL: https://github.com/apache/arrow/pull/10575#discussion_r673291847



##########
File path: python/pyarrow/_parquet.pyx
##########
@@ -952,6 +953,21 @@ cdef class ParquetReader(_Weakrefable):
 
         arrow_props.set_pre_buffer(pre_buffer)
 
+        if (
+            coerce_int96_timestamp_unit is None or
+            coerce_int96_timestamp_unit == "ns"
+        ):
+            arrow_props.set_coerce_int96_timestamp_unit(TimeUnit_NANO)
+        elif coerce_int96_timestamp_unit == "us":
+            arrow_props.set_coerce_int96_timestamp_unit(TimeUnit_MICRO)
+        elif coerce_int96_timestamp_unit == "ms":
+            arrow_props.set_coerce_int96_timestamp_unit(TimeUnit_MILLI)
+        elif coerce_int96_timestamp_unit == "s":
+            arrow_props.set_coerce_int96_timestamp_unit(TimeUnit_SECOND)
+        else:

Review comment:
       How about:
   ```
   elif coerce_int96_timestamp_unit is not None:
   ```
   
   so we'd leave `coerce_int96_timestamp_unit` to be set by the C++ implementation by default?




-- 
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-unsubscribe@arrow.apache.org

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