Repository navigation
Commit 3489284
[fix](be) Hold zoned Flight timestamp bounds with pytz's rounded offsets
### What problem does this PR solve?
Issue Number: None
Related PR: #69771
Problem Summary: For an Arrow timestamp with a time zone, the Flight
validator bounded values so that the local calendar in the zone, computed
by cctz with the exact offsets, stays in 0001..9999. PyArrow resolves the
zone name with pytz when pytz is installed, and pytz rounds every UTC
offset to whole minutes. With time_zone 'America/Chicago', whose local
mean time is -05:50:36, the lower bound 0001-01-01 05:50:36Z is local
0001-01-01 00:00:00 for cctz and zoneinfo, but 0000-12-31 23:59:36 for
pytz (-05:51), so TimestampScalar.as_py() still raised OverflowError on a
published batch.
The local bounds are now also computed with the offsets rounded the way
pytz does ((offset + 30) // 60 * 60, floor division), and the stricter
bound wins: 05:51:00Z in that example. Bounds whose offsets are whole
minutes (UTC, fixed offsets, the offsets at year 9999) do not change; for
a zone whose local mean time rounds to a larger negative offset, up to 30
seconds at the start of year 1 are now rejected for every client.
### Release note
None
### Check List (For Author)
- Test: Unit Test
- BE UT ArrowFlightTimestampTest.ZonedLowerBoundHoldsWithPytzRoundedOffsets:
America/Chicago's exact-offset start is rejected and 05:51:00Z is
accepted; the test fails when the bound uses the exact offset.
- Behavior changed: Yes. The values above are rejected.
- Does this need documentation: No
Co-Authored-By: Claude Opus 5.5 <[email protected]>1 parent 3b3f2a6 commit 3489284
2 files changed
Lines changed: 53 additions & 6 deletions
File tree
- be
- src/format/arrow
- test/format/arrow
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
68 | 78 | | |
69 | 79 | | |
70 | 80 | | |
| |||
89 | 99 | | |
90 | 100 | | |
91 | 101 | | |
92 | | - | |
93 | | - | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
94 | 107 | | |
95 | 108 | | |
96 | 109 | | |
97 | 110 | | |
98 | 111 | | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
103 | 125 | | |
104 | 126 | | |
105 | 127 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
182 | 207 | | |
183 | 208 | | |
184 | 209 | | |
| |||
0 commit comments