https://dagster.io/ logo
#integration-dbt
Title
# integration-dbt
k

Kyle Montag

02/06/2024, 1:57 PM
@sandy having an issue with
dagster-dbt
here's the details: • two models, one named
foo.bar
other named
baz.bar
dbt compile
/
dbt parse
runs without issue • when i materialize
foo.bar
via the dagster UI, the
dagster-dbt
system picks the selector for
baz.bar
looks to be related to [this](https://github.com/dagster-io/dagster/blob/ee5acad7526bf86fdf4c11d15e8332985973cde1/python_modules/libraries/dagster-dbt/dagster_dbt/utils.py#L[…]47) code, as it does
split(".")[-1]
which would only grab the
bar
part of my two model names. then it seems to grab the first matching entry from the manifest, which is
baz.bar
because of alpha sorting. any ideas on how to fix this properly? i'm happy to open a PR if this does seem to be the right spot to fix the issue
pushed a branch with a proposed fix and some test cases
❤️ 1
r

rex

02/07/2024, 1:38 AM
Will take a look tomorrow. Thanks for the contribution. FWIW, dbt does not recommend the use of dots in your model names. It's recommended that you use underscores. See https://docs.getdbt.com/best-practices/how-we-style/1-how-we-style-our-dbt-models
k

Kyle Montag

02/07/2024, 5:23 PM
changing to underscores instead of periods fixed this bug, still happy to work on this and merge if you think it is valuable though. i'm sure i can't have been the only one to see this issue 🙂 luckily i'm in a place where i can control how the models are named but i could see someone else not having that privilege
r

rex

02/14/2024, 4:04 PM
Closing the thread here: we landed support for this in https://github.com/dagster-io/dagster/pull/19769.
🙇 1
2 Views