rok commented on code in PR #39272:
URL: https://github.com/apache/arrow/pull/39272#discussion_r1430030116


##########
python/pyarrow/tests/test_types.py:
##########
@@ -487,6 +487,16 @@ def test_timestamp():
             pa.timestamp(invalid_unit)
 
 
+def test_timestamp_print():
+    for unit in ('s', 'ms', 'us', 'ns'):
+        for tz in ('UTC', 'Europe/Paris'):

Review Comment:
   ```suggestion
           for tz in ('UTC', 'Europe/Paris', 'Pacific/Marquesas', 
'Mars/Mariner_Valley', '-00:42', '+42:00'):
   ```



##########
cpp/src/arrow/util/formatting_util_test.cc:
##########
@@ -522,6 +522,22 @@ TEST(Formatting, Timestamp) {
     AssertFormatting(formatter, -2203932304LL * 1000000000LL + 8,
                      "1900-02-28 12:34:56.000000008");
   }
+
+  {
+    auto ty = timestamp(TimeUnit::SECOND, "US/Eastern");
+    StringFormatter<TimestampType> formatter(ty.get());
+
+    AssertFormatting(formatter, 0, "1970-01-01 00:00:00Z");
+    AssertFormatting(formatter, 1, "1970-01-01 00:00:01Z");
+    AssertFormatting(formatter, 24 * 60 * 60, "1970-01-02 00:00:00Z");
+    AssertFormatting(formatter, 616377600, "1989-07-14 00:00:00Z");
+    AssertFormatting(formatter, 951782400, "2000-02-29 00:00:00Z");
+    AssertFormatting(formatter, 63730281600LL, "3989-07-14 00:00:00Z");
+    AssertFormatting(formatter, -2203977600LL, "1900-02-28 00:00:00Z");
+
+    AssertFormatting(formatter, 1542129070, "2018-11-13 17:11:10Z");
+    AssertFormatting(formatter, -2203932304LL, "1900-02-28 12:34:56Z");
+  }

Review Comment:
   ```suggestion
   
     {
       auto timestamp_types = {timestamp(TimeUnit::SECOND, "US/Eastern"),
                             timestamp(TimeUnit::SECOND, "+01:00"),
                             timestamp(TimeUnit::SECOND, "-42:00"),
                             timestamp(TimeUnit::SECOND, "Pacific/Maruesas"),
                             timestamp(TimeUnit::SECOND, 
"Mars/Mariner_Valley")};
       for (auto ty : timestamp_types) {
         auto ty = timestamp(TimeUnit::SECOND, "US/Eastern");
         StringFormatter<TimestampType> formatter(ty.get());
     
         AssertFormatting(formatter, 0, "1970-01-01 00:00:00Z");
         AssertFormatting(formatter, 1, "1970-01-01 00:00:01Z");
         AssertFormatting(formatter, 24 * 60 * 60, "1970-01-02 00:00:00Z");
         AssertFormatting(formatter, 616377600, "1989-07-14 00:00:00Z");
         AssertFormatting(formatter, 951782400, "2000-02-29 00:00:00Z");
         AssertFormatting(formatter, 63730281600LL, "3989-07-14 00:00:00Z");
         AssertFormatting(formatter, -2203977600LL, "1900-02-28 00:00:00Z");
     
         AssertFormatting(formatter, 1542129070, "2018-11-13 17:11:10Z");
         AssertFormatting(formatter, -2203932304LL, "1900-02-28 12:34:56Z");
       }
     }
   ```



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