danepitkin commented on code in PR #36877:
URL: https://github.com/apache/arrow/pull/36877#discussion_r1276676467


##########
python/pyarrow/scalar.pxi:
##########
@@ -113,8 +113,12 @@ cdef class Scalar(_Weakrefable):
         else:
             with nogil:
                 check_status(self.wrapped.get().Validate())
-
+ 
     def __repr__(self):
+        if isinstance(self, TimestampScalar):

Review Comment:
   Good catch! Yes, let's include the timezone when supplied. Let's try and 
follow the ISO 8601 standard https://en.wikipedia.org/wiki/ISO_8601 and use 
`%z`. Maybe something like `%Y-%m-%dT%H:%M:%S%z` e.g.
   
   ```
   >>> res = pa.scalar("2000-01-01").cast(pa.timestamp("s"))
   >>> res_with_tz = pc.assume_timezone(res, "America/New_York")
   >>> str(pc.strftime(res_with_tz, format='%Y-%m-%dT%H:%M:%S%z'))
   '2000-01-01T00:00:00-0500'
   ```



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

Reply via email to