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

tab-complete arguments to --models and --exclude #1197

Closed
drewbanin opened this issue Dec 21, 2018 · 3 comments
Closed

tab-complete arguments to --models and --exclude #1197

drewbanin opened this issue Dec 21, 2018 · 3 comments
Labels
cli enhancement New feature or request

Comments

@drewbanin
Copy link
Contributor

Feature

Feature description

dbt should support tab-completion of model names in the --models and --exclude CLI arguments. This may prove difficult as dbt would need to know about all of the models on disk in order to provide completion suggestions. One option may be to use the manifest as a cache of existing model names. That would work well in many cases, but would also exclude brand-new models.

The --models and --exclude flags also accept tag: qualifiers. I'm unsure if the first version of this needs to account for tags, but that would certainly be nice!

Who will this benefit?

dbt users are increasingly implementing standards around how they name models. A very typical model may be named stg_server_event_active_pings, which is a whole lot of typing! dbt should encourage the use of descriptive model names, and the requirement to type out the exact model name when providing --models is a chore.

@mikekaminsky
Copy link
Contributor

Huge fan of this! In case it's helpful, here's how it was implemented in our similar-to-DBT project at Harry's: link

@joshtemple
Copy link
Contributor

Since dbt is using argparse, any thoughts on using the argcomplete library as a means of accomplishing this?

@drewbanin
Copy link
Contributor Author

Hey @mikekaminsky @joshtemple - check out this repo: https://github.com/fishtown-analytics/dbt-completion.bash

This works super well on macOS + Bash, but might need some more love to get it working in other OS's or shells! Wanted to give you guys a sneak preview for commenting on the issue -- will post about this in Slack at some point tomorrow :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants