[CT-3021] [Spike+] Interactive `dbt show` should not require model `name` to be present in `--select` arg
Housekeeping
- [X] I am a maintainer of dbt-core
Short description
When "interactive" dbt compile or dbt show are passed selection criteria that selects a single node, always include that node's compiled/previewed result in the logs.
If:
- you have a versioned model using the
defined_inversion config - the filename you choose does not contain the model name
- you use the
--select path:<path/to/file>method to unambiguously identify that resource (plus--indirect-selection emptyto exclude any tests defined on that model)
Current state: Because the model's name is not explicitly included in the --select argument, the compiled/previewed result is missing from the logs.
Acceptance state: dbt show always includes the compiled/previewed result if exactly one node has been selected for compilation/preview.
Acceptance criteria
Following the test case described above — a versioned model with a name different from its defined_in file name, with generic tests defined on it:
- Current state:
dbt compile --select path:<path/to/versioned/model/file> --indirect-selection emptyanddbt show --select path:<path/to/versioned/model/file> --indirect-selection emptydo not include the compiled/previewed result in the logs - Acceptance state: Those commands must include the compiled/previewed result in the logs
Impact to Other Teams
Exp/IDE. They will need to start passing --indirect-selection empty when doing --select interactive compiles/previews.
Will backports be required?
1.5.latest + 1.6.latest
Context
Currently, both "interactive" commands (dbt compile and dbt show) require that a model's name be explicitly included in the --select argument, when deciding which compiled / previewed result(s) to include in log output:
https://github.com/dbt-labs/dbt-core/blob/582faa129e8516bae38a4d42d4f8ed7892d4a99a/core/dbt/task/compile.py#L79-L83
https://github.com/dbt-labs/dbt-core/blob/582faa129e8516bae38a4d42d4f8ed7892d4a99a/core/dbt/task/show.py#L67-L70
While this is nice as a way of supporting dbt show --select model_one model_two, it also limits the other types of selection criteria (namely path: selection) that can be used to unambiguously select a single resource.
Related: Interactive command documentation
As discussed in refinement:
- let's spike this
- if it's a straightforward fix, go ahead and fix it!
Exp/IDE. They will need to start passing --indirect-selection empty when doing --select interactive compiles/previews.
@jtcohen6 What is the timeline on this?
@jtcohen6 What is the timeline on this?
I believe they're now doing this (slack thread), so no outstanding blockers here