Skip to content

feat(ingestion): add the shared backfill primitives - #849

Merged
jirhiker merged 1 commit into
stagingfrom
feat/backfill-primitives
Aug 19, 2026
Merged

feat(ingestion): add the shared backfill primitives#849
jirhiker merged 1 commit into
stagingfrom
feat/backfill-primitives

Conversation

@jirhiker

Copy link
Copy Markdown
Member

Task 4.1. automated_ingestion/shared/backfill.py, 27 tests, all pure — no
database, no network.

Written from the description, not ported

The plan says "port from Aqueduct". The Aqueduct checkout available here is an
empty directory skeleton — no source — so these were rebuilt from this plan's
description of them. Each docstring records provenance and what differs, so the
two can still be diffed by someone with both repositories open.

Flagging it because "ported" implies line-level fidelity that I cannot claim.

rows_upserted replaces posted/deleted

Not a rename. Aqueduct deletes a window and re-posts it because FROST has no
constraint to conflict on — hence two numbers, and a window during which the
data is missing. With the constraint from #847 Ocotillo upserts: one number, no
window.

Behaviours that are deliberate

Behaviour Why
Chunk edges clip, not widen Widening fetches data the operator did not ask for
Empty or reversed window is rejected A run that succeeds having done nothing is indistinguishable from one that worked
Unknown location_id fails the run, naming every bad id Same reason — silently backfilling nothing looks like success, and the gap is still there weeks later
Run keys are sanitized before becoming path segments One containing a slash writes checkpoints where a resumed run will not look
Naive dates are read as UTC The same run config must mean the same window on every machine

Marking a chunk under march gap and resuming under march-gap finds the same
checkpoint — there is a test, because that asymmetry would otherwise silently
redo work.

Deferred

atomic_write_json_with_retry() and a GCS-backed checkpoint store wait until
4.2 needs persistence. The CheckpointStore interface and an in-memory
implementation are here now, which is what makes the chunking and resumption
logic testable without object storage.

Not yet buildable

4.2 and 4.3 need point → deployment resolution, which is 3.2 — still blocked on
the 38-vs-33 monitoring point discrepancy. This is the part of T4 that does not
depend on it.

🤖 Generated with Claude Code

Chunking, run keys, location validation, and checkpoint tracking for both
backfill modes. All pure, so the logic is testable without object storage or a
database.

Written from this plan's description rather than ported line by line: the
Aqueduct checkout available here is an empty directory skeleton. Each docstring
records provenance and what differs so the two can still be diffed.

ChunkResult counts rows_upserted rather than Aqueduct's posted/deleted pair.
That is not a rename. Aqueduct deletes a window and re-posts it because FROST
has no constraint to conflict on, which gives it two numbers and a window where
the data is missing; with the constraint from 3.4 Ocotillo upserts, so there is
one number and no window.

Three behaviours are deliberate and tested. Chunk edges clip rather than widen,
so a backfill does not fetch data nobody asked for. An empty or reversed window
is rejected rather than treated as a no-op, because a run that succeeds having
done nothing looks exactly like one that worked. An unknown location id fails
the run naming every bad id, for the same reason.

Run keys are sanitized before becoming path segments: one containing a slash
would write checkpoints somewhere a resumed run would not look for them.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Coverage

79.49% total — gate is 75%.

Coverage for the Python files changed in this PR
Name Stmts Miss Cover Missing
automated_ingestion/shared/backfill.py 96 0 100%
TOTAL 96 0 100%

@github-actions

github-actions Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Your pull request is automatically being deployed to Dagster Cloud.

Location Status Link Updated
ocotillo-automated-ingestion View in Cloud Aug 19, 2026 at 05:44 AM (UTC)

@jirhiker
jirhiker merged commit 279ff6e into staging Aug 19, 2026
10 checks passed
@jirhiker
jirhiker deleted the feat/backfill-primitives branch August 19, 2026 05:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant