Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CT-2319] Selection for versioned models #7199

Closed
Tracked by #6747
MichelleArk opened this issue Mar 20, 2023 · 1 comment · Fixed by #7330
Closed
Tracked by #6747

[CT-2319] Selection for versioned models #7199

MichelleArk opened this issue Mar 20, 2023 · 1 comment · Fixed by #7330
Assignees
Labels
model_versions multi_project node selection Functionality and syntax for selecting DAG nodes Refinement Maintainer input needed

Comments

@MichelleArk
Copy link
Contributor

MichelleArk commented Mar 20, 2023

  • dbt run --select versioned_model should run all versions of the model by default
  • dbt run --select versioned_model.v2 should run just the specific model
  • potentially: syntax to select just the latest, or a specific model version.
@github-actions github-actions bot changed the title Support selecting latest or specified model version [CT-2319] Support selecting latest or specified model version Mar 20, 2023
@jtcohen6 jtcohen6 added node selection Functionality and syntax for selecting DAG nodes Team:Language labels Mar 26, 2023
@jtcohen6
Copy link
Contributor

syntax to select just the latest

How about:

$ dbt run --select version:latest

It should also be possible to select:

  • Models that are not versioned (version:none?)
  • Model versions that are newer than the latest version (version:prerelease?), and older than the latest version (version:old?). To do this, we'd need to know about how versions are ordered. Plain-old alphabetical sorting only works up to 10; we'd talked about implementing this for numeric values, and also supporting it for SemVer.

It's conceivable that folks will want to change the default behavior in development—include latest versions, prerelease versions, and models that aren't versioned—i.e. exclude "old" model versions—which they could accomplish by defining a default selector.

If we're able to come up with a syntax for these use cases sooner, we can pull it into the scope of this issue. Otherwise, it feels like a UX improvement that can come later.


or a specific model version

Given that each model has its own versioning scheme, and we're not prioritizing ergonomics/functionality for "bump the version for entire subset of models at once" — I don't think it makes sense to support a syntax for, "Select every model whose version is 2." If we did eventually want to do this, maybe it would look like dbt run --select version:2, but I don't care to do it within the scope of this issue.


For future consideration (also out of scope for this issue):

  • whether models with an upcoming deprecation_date should raise a warning whether selected
  • whether models past their deprecation_date should be selected, unselected, or full-on disabled by default

@MichelleArk MichelleArk changed the title [CT-2319] Support selecting latest or specified model version [CT-2319] Selection for versioned models Apr 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
model_versions multi_project node selection Functionality and syntax for selecting DAG nodes Refinement Maintainer input needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants