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 2022/06/08 23:09:24 UTC

[GitHub] [arrow] coryan commented on a diff in pull request #12763: ARROW-14892: [Python][C++] GCS Bindings

coryan commented on code in PR #12763:
URL: https://github.com/apache/arrow/pull/12763#discussion_r892936494


##########
python/pyarrow/_gcsfs.pyx:
##########
@@ -151,17 +159,17 @@ cdef class GcsFileSystem(FileSystem):
     def _reconstruct(cls, kwargs):
         return cls(**kwargs)
 
-    def _expiration_datetime_from_options(self):
+    def _expiration_ns_from_options(self):
         expiration_ns = TimePoint_to_ns(
             self.gcsfs.options().credentials.expiration())
         if expiration_ns == 0:
             return None
-        return datetime.fromtimestamp(expiration_ns / 1e9)

Review Comment:
   GCS (the service) returns a RFC 3339 timestamp, always in the UTC (Zulu) timezone.  The C++ client library converts that to a `std::chrono::system_clock::time_point`, always using UTC.
   
   I think the issue here is that on macOS `std::chrono::system_block::time_point` does not have nanosecond precision.  It only has microsecond precision:
   
   https://stackoverflow.com/questions/65397041/apple-clang-why-can-i-not-create-a-time-point-from-stdchrononanoseconds
   
   Consider relaxing the test condition to accept timestamps within a range. 



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