Repository navigation
Commit 8e8ad74
committed
fix(state_sync): skip interval removal when there is nothing to remove
`remove_intervals` unconditionally called `insert_append`, which raises
"Cannot construct source query from an empty DataFrame" when there are no
intervals to remove.
With `remove_shared_versions=True` the rows to write are rebuilt by querying
the `_intervals` table for rows sharing the target name/versions. When none of
the affected snapshots have any rows there, for example an un-backfilled
snapshot version held by another environment, the resulting set is empty and
the insert fails. This surfaced as a non-zero exit code at the end of an
otherwise successful prod restatement, after the model batches had already
been backfilled and committed.
Return early instead, matching the guards already present on the neighbouring
insert paths `add_snapshots_intervals` and `_push_snapshot_intervals`.
Fixes #5909
Signed-off-by: Amir Vakili <AVakili@Voleon.com>1 parent 869248c commit 8e8ad74
2 files changed
Lines changed: 37 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
111 | 114 | | |
112 | 115 | | |
113 | 116 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
400 | 400 | | |
401 | 401 | | |
402 | 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 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
403 | 437 | | |
404 | 438 | | |
405 | 439 | | |
| |||
0 commit comments