Skip to content

Commit 469a32a

Browse files
adriangbclaude
andcommitted
test: cover a DST summer instant for from_unixtime in America/Denver
The named-zone test only checked a January instant, which renders `-07:00`. That result is equally consistent with a DST-aware zone and with an implementation that wrongly treated America/Denver as a fixed `-07:00` offset, so it did not prove DST handling. Adds a July instant, 2024-07-01T12:00:00Z, under the same session zone. It must render `2024-07-01T06:00:00-06:00`, which only a DST-aware zone produces. Expected output generated by running the query; changing it to `-07:00` makes the file fail. Suggested in review by @kosiew. Co-Authored-By: Claude Opus 5 <[email protected]>
1 parent fb72121 commit 469a32a

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎datafusion/sqllogictest/test_files/from_unixtime_timezone.slt‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,13 @@ SELECT arrow_typeof(from_unixtime(1704110400)), from_unixtime(1704110400);
5555
----
5656
Timestamp(s, "America/Denver") 2024-01-01T05:00:00-07:00
5757

58+
# January alone (`-07:00`) cannot tell a DST-aware zone from a fixed `-07:00`
59+
# offset. A July instant must render `-06:00`, which only a DST-aware zone does.
60+
query TP
61+
SELECT arrow_typeof(from_unixtime(1719835200)), from_unixtime(1719835200);
62+
----
63+
Timestamp(s, "America/Denver") 2024-07-01T06:00:00-06:00
64+
5865
## Test 4: an explicit timezone argument wins over the session time zone
5966
query TP
6067
SELECT

0 commit comments

Comments
 (0)