-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
dbt ls command (#467) #1436
dbt ls command (#467) #1436
Conversation
All tasks now have a 'pre_init_hook' classmethod, called by main - runs after args are parsed, before anything else
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One minor comment below, and some feedback after playing around with this a little more. There might be merit to supporting a --models
flag which
- specifies the
--select
argument and - constrains the
--resource-type
argument tomodels
Because --models
implies both a resource type and a selector, I think these flags should be mutually exclusive. That is: if --models
is supplied, then neither --select
nor --resource-type
can be supplied.
This is motivated by my typing dbt ls --models ...
repeatedly in testing this PR out :)
Do you buy this?
core/dbt/main.py
Outdated
required=False, | ||
nargs='+', | ||
help="Specify the nodes to select.", | ||
dest='models' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you change this to selection
or selector
? It renders as
-s MODELS [MODELS ...], --select MODELS [MODELS ...]
in --help
Fixed error logging to display errors in dbt ls Add models flag Make all of models, select, exclude have a metavar of 'SELECTOR' for -h
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works super well! Did you get to a resolution on the TODOs in the PR body?
- figure out the original_file_path situation
- some level of selection syntax testing
Happy to help with these if not!
Oops, I did resolve those! Well, I think I did - pretty sure the old |
Fixes #467
One change I had to make: the
original_file_path
now points at the actual original file path, rather than a weird combination of the compiled path + the root of the search that sometimes doesn't exist. Models and such retained their original correct paths.