Describe the bug
timestamp_ntz_to_timestamp panics when a local time is ambiguous or non-existent due to DST transitions:
- Non-existent (spring forward): e.g.
2024-03-31 01:30:00 in Europe/London — this time never occurs as clocks skip from 01:00 → 02:00, so LocalResult::None is returned and from_local_datetime(...).unwrap() panics.
- Ambiguous (fall back): e.g.
2024-10-27 01:30:00 in Europe/London — this time occurs twice as clocks repeat 01:00 → 02:00, so LocalResult::Ambiguous is returned and from_local_datetime(...).unwrap() panics.
Both the TimestampMicrosecondType and TimestampMillisecondType branches are affected.
Steps to reproduce
// Non-existent time — spring forward
timestamp_ntz_to_timestamp(array_containing("2024-03-31 01:30:00"), "Europe/London", None); // panic!
// Ambiguous time — fall back
timestamp_ntz_to_timestamp(array_containing("2024-10-27 01:30:00"), "Europe/London", None); // panic!
Expected behavior
The function should handle all LocalResult variants from from_local_datetime(...) without panicking. For ambiguous times, opt for the earlier option (consistent with e.g. Apache Spark). For a non-existent time, treat it like that time shifted an hour before.
Additional context
No response
Describe the bug
timestamp_ntz_to_timestamppanics when a local time is ambiguous or non-existent due to DST transitions:2024-03-31 01:30:00inEurope/London— this time never occurs as clocks skip from 01:00 → 02:00, soLocalResult::Noneis returned andfrom_local_datetime(...).unwrap()panics.2024-10-27 01:30:00inEurope/London— this time occurs twice as clocks repeat 01:00 → 02:00, soLocalResult::Ambiguousis returned andfrom_local_datetime(...).unwrap()panics.Both the
TimestampMicrosecondTypeandTimestampMillisecondTypebranches are affected.Steps to reproduce
Expected behavior
The function should handle all
LocalResultvariants fromfrom_local_datetime(...)without panicking. For ambiguous times, opt for the earlier option (consistent with e.g. Apache Spark). For a non-existent time, treat it like that time shifted an hour before.Additional context
No response