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

Update recommended syntax for --select with unions + intersections on CLI #4040

Closed
1 task done
Tracked by #8600
jtcohen6 opened this issue Sep 7, 2023 · 3 comments
Closed
1 task done
Tracked by #8600
Assignees
Labels
cloud-cli-beta content Improvements or additions to content improvement Use this when an area of the docs needs improvement as it's currently unclear

Comments

@jtcohen6
Copy link
Collaborator

jtcohen6 commented Sep 7, 2023

Docs project

Contributions

  • I have read the contribution docs, and understand what's expected of me.

Link to the page on docs.getdbt.com requiring updates

https://docs.getdbt.com/reference/node-selection/set-operators
https://docs.getdbt.com/reference/commands/list

(I'm sure there are many more pages)

What part(s) of the page would you like to see updated?

To conform to POSIX standards, and for better readability, we should strongly encourage CLI users to quote unions/intersections passed to "multi-option" params. Unquoted may not work consistently across all operating systems, terminals, and product experiences.

This is mainly relevant for --select and --exclude.

So instead of:

$ dbt run --select +snowplow_sessions +fct_orders
$ dbt run --select +snowplow_sessions,+fct_orders
$ dbt run --select stg_invoices+,stg_accounts+

It should be:

$ dbt run --select "+snowplow_sessions +fct_orders"
$ dbt run --select "+snowplow_sessions,+fct_orders"
$ dbt run --select "stg_invoices+,stg_accounts+"

It is also relevant for the --output-keys param to dbt list. So instead of

$ dbt ls --select snowplow.* --output json --output-keys name resource_type description

It should be:

$ dbt ls --select snowplow.* --output json --output-keys "name resource_type description"

Additional information

internal notion doc

@jtcohen6 jtcohen6 added content Improvements or additions to content improvement Use this when an area of the docs needs improvement as it's currently unclear labels Sep 7, 2023
@mirnawong1 mirnawong1 self-assigned this Sep 7, 2023
@mirnawong1
Copy link
Contributor

mirnawong1 commented Sep 28, 2023

hey @jtcohen6 , would dbt run --select state:modified need to have "state:modified" quoted? (and exposures too?)

@jtcohen6
Copy link
Collaborator Author

@mirnawong1 This is only required when there are multiple space-delimited or comma-delimited arguments being passed to --select or --exclude

So it's not strictly necessary for --select state:modified (only one argument). But --select "state:modified" works too — so we could just say "always quote" :)

@mirnawong1
Copy link
Contributor

sounds like a good, consistent plan. thanks for clarifying @jtcohen6 !

This was referenced Oct 3, 2023
mirnawong1 added a commit that referenced this issue Oct 17, 2023
runleonarun added a commit that referenced this issue Feb 2, 2024
## What are you changing in this pull request and why?

Closes #3608

Some of the work was addressed in
#4040. This PR removes
v 0.18 references and makes the v 0.19 content current

## Checklist
- [x] Review the [Content style
guide](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/content-style-guide.md)
so my content adheres to these guidelines.
- [x] For [docs
versioning](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/single-sourcing-content.md#about-versioning),
review how to [version a whole
page](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/single-sourcing-content.md#adding-a-new-version)
and [version a block of
content](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/single-sourcing-content.md#versioning-blocks-of-content).
- [x] Add a checklist item for anything that needs to happen before this
PR is merged, such as "needs technical review" or "change base branch."

---------

Co-authored-by: Matt Shaver <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cloud-cli-beta content Improvements or additions to content improvement Use this when an area of the docs needs improvement as it's currently unclear
Projects
None yet
Development

No branches or pull requests

2 participants