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

dbt ls command (#467) #1436

Merged
merged 4 commits into from
May 9, 2019
Merged

dbt ls command (#467) #1436

merged 4 commits into from
May 9, 2019

Conversation

beckjake
Copy link
Contributor

@beckjake beckjake commented May 1, 2019

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.

Jacob Beck added 2 commits May 1, 2019 07:11
All tasks now have a 'pre_init_hook' classmethod, called by main
 - runs after args are parsed, before anything else
@beckjake beckjake marked this pull request as ready for review May 2, 2019 17:13
Copy link
Contributor

@drewbanin drewbanin left a 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

  1. specifies the --select argument and
  2. constrains the --resource-type argument to models

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'
Copy link
Contributor

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
Copy link
Contributor

@drewbanin drewbanin left a 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!

@beckjake
Copy link
Contributor Author

beckjake commented May 9, 2019

Oops, I did resolve those! Well, I think I did - pretty sure the old original_file_path was wrong and my changes are right.

@beckjake beckjake merged commit cc8ef47 into dev/wilt-chamberlain May 9, 2019
@beckjake beckjake deleted the feature/dbt-ls branch May 9, 2019 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

new command: dbt ls
2 participants