Include notebooks and data preparations in tag/action selection#2196
Draft
rbscgh wants to merge 1 commit into
Draft
Include notebooks and data preparations in tag/action selection#2196rbscgh wants to merge 1 commit into
rbscgh wants to merge 1 commit into
Conversation
prune() only considered tables, operations and assertions when computing
the set of actions selected by --tags / --actions. Notebooks and data
preparations were excluded from the selection union, so a tag selector
could never match them, and they leaked through the returned graph
unfiltered (passed via the spread but never filtered).
This meant a notebook registered with a tag via the JS API, e.g.
notebook({ name: "run_notebook", filename: "...", tags: ["reconciliation"] })
would not appear when executing by that tag in the CLI or UI.
Add notebooks and data preparations to both the selection union (so tag
and action selectors match them and dependency/dependent traversal
includes them) and the filtered output graph.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
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.
Summary
prune()(cli/api/commands/prune.ts) — the function that turns a compiled graph plus a run config (selected tags/actions) into the set of actions to execute — only considered tables, operations and assertions. Notebooks and data preparations were:--tags(or--actions) selector could never match them, and dependency/dependent traversal never reached them....compiledGraphspread unchanged, so they neither got correctly included by tag nor correctly excluded.Net effect: a notebook registered with a tag via the JS API, e.g.
would not appear when you "execute by tag" in the CLI or the UI — the tagged notebook was silently dropped from the selected-actions list (e.g. 5 actions shown instead of 6).
The notebook proto itself is fine —
core/actions/notebook.tscorrectly setsproto.tags, andnotebook_test.tsalready asserts the tags survive compilation. The defect was purely in the downstream selection step.This isn't a niche path — tagging notebooks via the JS API is a documented, commonly-used pattern (e.g. this walkthrough: https://gtm-gear.com/posts/dataform-notebooks/).
Changes
notebooksanddataPreparationsto theallActionsunion incomputeIncludedActionNames, so tag/action selectors match them and dependency/dependent traversal includes them.notebooksanddataPreparationsin the returned graph instead of leaking them through the spread.CompileActiontype to includeINotebook | IDataPreparation.Data preparations had the identical defect (same
tags+dependencyTargetsshape, same exclusion), so they're fixed symmetrically.Test plan
prune notebooks and data preparations with --tags— atag1notebook/dp is selected, atag2one is dropped (matching the operation behavior alongside it).prune notebooks with --tags pulls in dependencies— selecting by a notebook's tag withincludeDependenciespulls in its untagged dependency.bazel test //tests/api:api.specpasses (all 6 pre-existing prune tests + 2 new).bazel test //core:actions/notebook_test //core:actions/data_preparation_testpasses.🤖 Generated with Claude Code