Repository navigation
Commit 5e4f6b6
fix(charts): align grain-less time offsets on wall clock
Shifting a timezone-aware series with DateOffset raised out of pandas
when the shift landed on a local hour that DST skips or repeats
(NonExistentTimeError / AmbiguousTimeError), and the free-form parser
branch added its delta as absolute time, silently drifting the wall
clock by an hour across a DST boundary. Drop the timezone on both sides
of the join and align on wall clock, which is what the offset query's
own time range was shifted by, so its rows carry the source wall clock.
Free-form offsets are now required to denote a constant shift. Phrases
parsedatetime resolves to a fixed point ("yesterday", "last month")
anchor every source time within a day onto one 09:00 timestamp, so
applied per row they move each row by a different amount and collapse
distinct timestamps onto a single join key. They fail with the existing
missing-grain error instead.
Also express an "inherit" offset in seconds rather than days: the
timedelta.days truncation compared a sub-day range against itself
("0 days ago") and overlapped ranges that were not a whole number of
days. Whole-day ranges resolve to the same instant as before.
Co-Authored-By: Claude Opus 4.8 <[email protected]>1 parent 453965c commit 5e4f6b6
5 files changed
Lines changed: 292 additions & 44 deletions
File tree
- superset
- models
- utils
- tests/unit_tests
- common
- utils
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
| 143 | + | |
143 | 144 | | |
144 | 145 | | |
145 | 146 | | |
| |||
173 | 174 | | |
174 | 175 | | |
175 | 176 | | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
176 | 187 | | |
177 | 188 | | |
178 | 189 | | |
| |||
2190 | 2201 | | |
2191 | 2202 | | |
2192 | 2203 | | |
2193 | | - | |
2194 | | - | |
| 2204 | + | |
| 2205 | + | |
| 2206 | + | |
| 2207 | + | |
| 2208 | + | |
| 2209 | + | |
| 2210 | + | |
| 2211 | + | |
| 2212 | + | |
2195 | 2213 | | |
2196 | 2214 | | |
2197 | 2215 | | |
| |||
2353 | 2371 | | |
2354 | 2372 | | |
2355 | 2373 | | |
2356 | | - | |
2357 | | - | |
| 2374 | + | |
| 2375 | + | |
| 2376 | + | |
| 2377 | + | |
| 2378 | + | |
| 2379 | + | |
| 2380 | + | |
| 2381 | + | |
| 2382 | + | |
| 2383 | + | |
| 2384 | + | |
2358 | 2385 | | |
2359 | 2386 | | |
2360 | 2387 | | |
| |||
2379 | 2406 | | |
2380 | 2407 | | |
2381 | 2408 | | |
| 2409 | + | |
| 2410 | + | |
2382 | 2411 | | |
2383 | 2412 | | |
2384 | 2413 | | |
| |||
2388 | 2417 | | |
2389 | 2418 | | |
2390 | 2419 | | |
2391 | | - | |
| 2420 | + | |
2392 | 2421 | | |
2393 | 2422 | | |
2394 | 2423 | | |
2395 | | - | |
2396 | | - | |
2397 | | - | |
2398 | | - | |
2399 | | - | |
2400 | | - | |
2401 | | - | |
2402 | | - | |
2403 | | - | |
2404 | | - | |
2405 | | - | |
2406 | | - | |
2407 | | - | |
2408 | | - | |
2409 | | - | |
| 2424 | + | |
| 2425 | + | |
| 2426 | + | |
| 2427 | + | |
| 2428 | + | |
| 2429 | + | |
| 2430 | + | |
| 2431 | + | |
| 2432 | + | |
| 2433 | + | |
| 2434 | + | |
| 2435 | + | |
| 2436 | + | |
2410 | 2437 | | |
2411 | | - | |
2412 | 2438 | | |
2413 | | - | |
| 2439 | + | |
2414 | 2440 | | |
2415 | 2441 | | |
2416 | | - | |
| 2442 | + | |
2417 | 2443 | | |
2418 | 2444 | | |
2419 | | - | |
| 2445 | + | |
2420 | 2446 | | |
2421 | 2447 | | |
2422 | 2448 | | |
2423 | 2449 | | |
2424 | 2450 | | |
2425 | | - | |
| 2451 | + | |
2426 | 2452 | | |
2427 | 2453 | | |
2428 | 2454 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
63 | 74 | | |
64 | 75 | | |
65 | 76 | | |
| |||
158 | 169 | | |
159 | 170 | | |
160 | 171 | | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
161 | 197 | | |
162 | 198 | | |
163 | 199 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| 30 | + | |
29 | 31 | | |
30 | 32 | | |
31 | 33 | | |
| |||
389 | 391 | | |
390 | 392 | | |
391 | 393 | | |
392 | | - | |
393 | | - | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
394 | 433 | | |
395 | 434 | | |
396 | 435 | | |
| |||
0 commit comments