dbt-labs / dbt-core

dbt enables data analysts and engineers to transform their data using the same practices that software engineers use to build applications.
https://getdbt.com
Apache License 2.0
9.69k stars 1.61k forks source link

[CT-3021] [Spike+] Interactive `dbt show` should not require model `name` to be present in `--select` arg #8472

Open jtcohen6 opened 1 year ago

jtcohen6 commented 1 year ago

Housekeeping

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:

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:

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.

QMalcolm commented 1 year ago

Related: Interactive command documentation

graciegoheen commented 1 year ago

As discussed in refinement:

graciegoheen commented 1 year ago

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 commented 11 months ago

@jtcohen6 What is the timeline on this?

I believe they're now doing this (slack thread), so no outstanding blockers here