PicnicSupermarket / dbt-score

Linter for dbt metadata
https://dbt-score.picnic.tech
MIT License
84 stars 7 forks source link

Enabling full functionality of dbt ls for dbt-score? #52

Closed ofranz closed 3 months ago

ofranz commented 3 months ago

I wanted to test out the possibility of running dbt-score within our CI pipeline. For this I'd like to select only the models that have been modified.

The command in dbt ls works fine (dbt ls -s state:modified --state ...) but the corresponding call with dbt-score (dbt-score lint -s state:modified --state ...) fails (Error: No such option: --state).

Is it me or is there a limitation in the call definition for the dbt runner?

jochemvandooren commented 3 months ago

Hey, thanks for raising the issue!

I think what's happening is that the CLI of dbt-score is telling you that there's no option --state. This happens because it only sees state:modified as the value for -s, --state is parsed separately.

Could you try again but then enclosing the whole select statement in quotes? dbt ls -s "state:modified --state ..." Let me know if that works for you!

ofranz commented 3 months ago

Adding the quotes in the dbt-score command actually fixed it! Thanks for the quick reply!

dbt-score lint "-s state:modified --state ..."

jochemvandooren commented 3 months ago

Great to hear! Happy scoring :grin: