-
Notifications
You must be signed in to change notification settings - Fork 72
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
Exposures command references wrong models due to same alias #282
Comments
Make a minimal example (e.g. only 2 models), specifying your expected and actual behaviour, then I'll have a look. |
As you noticed in #286 (comment), clashing table names are not supported. Dependencies are manually parsed from Metabase cards, including native SQL queries, and there's no way to distinguish which table Here's the code, if you're interested dbt-metabase/dbtmetabase/_exposures.py Lines 221 to 311 in 602192e
|
I'm experimenting with an enhancement to allow clashing table names in #287. @jefersonmsantos Can you try installing from this branch and test it out with your project?
|
@gouline With this branch, all
|
Try reinstalling and running again, you should have a For example:
I haven't used dbt with BigQuery, not sure what it would use for |
We use dbt alias on our dbt project. For example, below model has name
finance__subscriptions
but its alias issubscriptions
. The table created on the warehouse will besubscriptions
and Metabase will read this table with namesubscriptions
.When we use command
dbt-metabase exposures
, charts / dashboards / queries using this model will be identified with depends on by the name of the table on Metabase, that issubscriptions
.However, models are loaded from manifest_file on
_exposures.py
by the name of the model, that isfinance__subscriptions
:This way, they will not match and this finance__subscription model will not be referenced as a dependency. Also, we have a source with name
subscriptions
, that matches the alias of the other model. So, on this situation, exposures are referencing a source instead of the correct model.Is there anyway to reference not only table_name, but also schemas to avoid these mistakes? Is there anyway to consider alias instead of names?
The text was updated successfully, but these errors were encountered: