Repository navigation
fix: run BigQuery expectations on the data branch copy - #1851
Merged
Merged
Conversation
On a data branch (SL_DATA_BRANCH), native BigQuery transforms and native BigQuery loads write to <branch>.<table>, but their expectations still queried the production table, so a branch run could pass its checks on production data. - AutoTask: new overridable expectationTarget, used by runExpectations and runAndSinkExpectations; BigQueryAutoTask returns the branch target when a branch is active. - IngestionExpectations: expectations of a native BigQuery load on a branch check the branch copy; Spark loads never branch and keep checking the loaded table. The load target resolution is shared with BigQueryNativeLoader through BigQueryNativeLoader.originalTableId. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
hayssams
added a commit
to starlake-ai/starlake-docs
that referenced
this pull request
Oct 20, 2026
starlake-ai/starflow#1851 makes expectations of branched native BigQuery transforms and loads check the branch copy. The unreleased docs describe the new behavior; the 1.8.9 docs keep the limitation, now covering loads too, and point to the fix. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 task done
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.
Problem
On a data branch (
SL_DATA_BRANCH), native BigQuery transforms and native BigQuery loads write to<branch>.<table>, but their expectations still querieddomain.table, i.e. the production table. A branch run could therefore pass its expectations on production data and never check what it actually wrote.Fix
AutoTask,BigQueryAutoTask): new overridableexpectationTarget(database, domain, table), used byrunExpectationsandrunAndSinkExpectations. It defaults to the task's target;BigQueryAutoTaskreturns its branch target when a branch is active.IngestionExpectations): when the native BigQuery loader runs on a branch, expectations check<project>.<branch>.<table>. Spark loads never branch, so they keep checking the loaded table. The target resolution is shared withBigQueryNativeLoaderviaBigQueryNativeLoader.originalTableId.IngestionExpectations.expectationJob(handler)is split out ofrunExpectationsWithHandlerso tests can build the job without sinking reports.Expectation reports on a branch now record the branch as their domain, which tells branch runs apart from production runs in the expectations audit table.
Tests
BigQueryBranchExpectationsSpec(transform): branch run checksprj.sl_branch.order_summary, non-branch run checksprj.kpi.order_summary.BigQueryBranchLoadExpectationsSpec(load): native load on a branch checksprj.sl_branch.orders; native load without a branch and Spark load on a branch checksales.orders.testOnly ai.starlake.job.ingest.* ai.starlake.job.transform.*: 101 passed.scalafmtCheckAllclean.BigQueryBranchSpec(SL_REMOTE_TEST).Suggested changelog entry (1.8.14)
Bug fix:
SL_DATA_BRANCHset, native BigQuery transforms and loads wrote to the branch dataset but ran their expectations against the production table. They now check the table the job actually wrote.Follow-up
starlake-ai/starlake-docs#45 lists this as a limitation; update that line once this ships.
🤖 Generated with Claude Code