Dry runs#351
Open
Scr4tch587 wants to merge 9 commits into
Open
Conversation
Introduce a Store ABC with PostgresStore (forwards to core.db.datasets) and MemoryStore (in-process dict, no DB connection) backends, and thread a store through run_build -> execute_job -> _fetch_dep_data. The store also owns the build lock: PostgresStore uses the shared per-dataset lock, MemoryStore uses a nullcontext. Real builds default to PostgresStore, so behavior is unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
build_dataset(dry_run=...) is the single boundary that reads the flag: it constructs a PostgresStore (real build, returns None) or a fresh MemoryStore (dry run) and passes it into run_build. A dry run rebuilds the whole graph in isolation and returns the produced rows for the requested dataset. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
POST /build accepts ?dry-run=true (default false). A dry run runs builders over
the whole dependency graph in memory without writing to the DB and returns the
produced rows; real builds still return {"status": "ok"}. Errors keep the same
400/422/500 semantics. Adds integration coverage for DB-unchanged, builders
running, chain/lookback graphs, and PostgresStore/MemoryStore read parity.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Add
?dry-run=truetoPOST /build. Runs the full build (including all dependencies) against an in-memory store, writes nothing to the DB, and returns the produced rows so builder logic can be validated.How
StoreABC over the four build-path data opsPostgresStore— thin shell overcore.db.datasets(real builds)MemoryStore— in-process dict backend (dry runs)storethreaded throughrun_build → execute_job → _fetch_dep_datacore.db.datasetsdirectlybuild_dataset(dry_run=...)is the single boundary that selects the storeMemoryStorestarts empty, so a dry run rebuilds the whole graph in isolationnullcontext) — a dry run can't corrupt real dataJsonbserializationResponse
{"status": "ok"}{dataset_name, dataset_version, dry_run, rows}Why
Testing
MemoryStoreunit suite +PostgresStore/MemoryStoreread-method parity