feat(cli): node selection for dataform compile#2212
Open
alandrebraga wants to merge 1 commit into
Open
Conversation
|
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. |
949c973 to
9fa4e64
Compare
Adds --actions/--tags/--include-deps/--include-dependents to `dataform compile`, filtering the printed graph via the existing prune() used by run/build. This is output filtering only; the full project still compiles (ref() resolution needs every action registered). Resolves dataform-co#2203 Co-Authored-By: Ivan Histand <[email protected]>
9fa4e64 to
2d1b912
Compare
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
Adds node selection to
dataform compile, mirroringdbt compile --select.compilenow accepts the same selection flags asrun/build—--actions,--tags,--include-deps,--include-dependents— and filters the printed graph to just the selected action(s):Resolves #2203.
How it works
This is output filtering, not partial compilation. The whole project must
still compile (
ref()resolution and the dependency graph require every actionregistered), so we compile fully and then prune the result before printing —
reusing the existing
prune()thatrun/buildalready use, plus the sharedyargs option definitions. No proto changes.
--actions/--tags) is present.prune's run-side behavior.--include-deps/--include-dependentskeep their existing validation (only valid alongside--actions/--tags).Tests
New
compile node selectionsuite incli/index_compile_test.tsover anupstream -> midstream -> downstreamproject, covering: full graph (no selector),--actions,--include-deps,--include-dependents,--tags, empty-matchexits 0, and the no-selector validation error.
//cli:index_compile_testpasses.Credit
Implementation by @ihistand (Ivan Histand), proposed in SQLAnvil/sqlanvil#27 in
response to this issue. Thank you!