jorisvandenbossche commented on code in PR #12528:
URL: https://github.com/apache/arrow/pull/12528#discussion_r875957401
##########
cpp/src/arrow/compute/kernels/scalar_temporal_test.cc:
##########
@@ -2854,17 +2854,66 @@ TEST_F(ScalarTemporalTest,
TestCeilFloorRoundTemporalNonexistent2) {
R"(["2015-03-29 00:52:00", "2015-03-29 01:12:00", "2015-03-29 01:12:00",
"2015-03-29 01:12:00", "2015-03-29 01:12:00", "2015-03-29
01:12:00"])";
const char* times_floor =
- R"(["2015-03-29 00:52:00", "2015-03-29 00:52:00", "2015-03-29 00:52:00",
- "2015-03-29 00:52:00", "2015-03-29 00:52:00", "2015-03-29
01:12:00"])";
+ R"(["2015-03-29 00:52:00", "2015-03-29 00:56:00", "2015-03-29 00:56:00",
+ "2015-03-29 00:56:00", "2015-03-29 00:56:00", "2015-03-29
01:12:00"])";
const char* times_round =
- R"(["2015-03-29 00:52:00", "2015-03-29 01:08:00", "2015-03-29 01:12:00",
+ R"(["2015-03-29 00:52:00", "2015-03-29 00:56:00", "2015-03-29 01:12:00",
"2015-03-29 01:12:00", "2015-03-29 01:12:00", "2015-03-29
01:12:00"])";
CheckScalarUnary("ceil_temporal", unit, times, unit, times_ceil, &options);
CheckScalarUnary("floor_temporal", unit, times, unit, times_floor, &options);
CheckScalarUnary("round_temporal", unit, times, unit, times_round, &options);
}
+TEST_F(ScalarTemporalTest, TestCeilFloorRoundTemporalDSTJump) {
+ // Europe/Brussels switches from UTC+2:00 to UTC+1:00 on 2015-10-29 03:00:00
UTC+2:00
+ // This causes an hour long ambiguous period in local time.
+ // Europe/Brussels switches from UTC+1:00 to UTC+2:00 on 2018-03-28 02:00:00
UTC+1:00
+ // This causes an hour long non-existing period in local time.
+ auto unit = timestamp(TimeUnit::SECOND, "Europe/Brussels");
+ auto options = RoundTemporalOptions(256, CalendarUnit::MINUTE);
+ const char* times =
+ R"(["2015-03-28 21:31:00", "2015-03-28 23:32:00", "2015-03-28 23:33:00",
+ "2015-03-28 23:53:00", "2015-03-29 01:08:00", "2015-03-29 01:28:00",
+ "2015-03-29 01:32:00", "2015-03-29 01:51:00", "2015-03-29 02:12:00",
+ "2015-03-29 02:44:00", "2015-03-29 02:59:00", "2015-03-29 03:02:00",
+ "2015-03-29 03:08:00", "2015-03-29 03:26:00", "2015-03-29 04:59:00",
+ "2018-10-27 20:44:00", "2018-10-27 21:45:00", "2018-10-27 22:46:00",
+ "2018-10-27 23:09:00", "2018-10-27 23:10:00", "2018-10-27 23:11:00",
+ "2018-10-28 03:14:00", "2018-10-28 04:15:00", "2018-10-28
05:16:00"])";
Review Comment:
Is it actually needed to have that many dates to cover the different cases
you can run into here? Because it does make the test harder to understand
--
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]