z3z1ma / dbt-osmosis

Provides automated YAML management, a dbt server, streamlit workbench, and git-integrated dbt model output diff tools
https://z3z1ma.github.io/dbt-osmosis/
Apache License 2.0
422 stars 45 forks source link

Specify selected models by paths in the sub commands of `dbt-osmosis yaml` #102

Closed yu-iskw closed 9 months ago

yu-iskw commented 9 months ago

Motivation

We can specify selected models by unique IDs of models. That wouldn't be a bit intuitive, as we have to figure out the desired unique IDs a head. But the step is almost required, since there are hundreds of dbt models in our dbt project. So, it would be awesome to select models by paths to dbt modes too.

z3z1ma commented 9 months ago

This should already be the case

https://z3z1ma.github.io/dbt-osmosis/docs/tutorial-yaml/selection#positional-selectors

dbt-osmosis yaml refactor path/to/models other/**/path/here/*

fqn selection will probably be fully dropped. While our selection isn't as robust or "graph-like" as dbt's, it works well for managing yaml. That being said, I could see using the dbt ls method from python to support even more canonical selection if we wanted. The nice part about paths though is that they work great with pre-commit.

yu-iskw commented 9 months ago

@z3z1ma Thank you for the information. I will give it a try again.