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

Exposures have no dependencies. depends_on arrays are empty #260

Closed
ampersand-five opened this issue Jun 17, 2024 · 8 comments
Closed

Exposures have no dependencies. depends_on arrays are empty #260

ampersand-five opened this issue Jun 17, 2024 · 8 comments
Labels
bug Something isn't working

Comments

@ampersand-five
Copy link

I updated dbt-metabase from 1.0.1 to 1.3.1 and after doing that when I run exposures, all the depends_on arrays are now empty, where as before they were not. Which makes the dependency graph flat now, i.e. broken.

Any ideas as to why the depends_on in exposures is now not populating?

@gouline
Copy link
Owner

gouline commented Jun 18, 2024

I need more details to reproduce this:

  1. dbt version(s)
  2. Metabase version(s)
  3. Database type(s), e.g. PostgreSQL, Snowflake, BigQuery
  4. Exposures type(s), e.g. dashboard, question from a table, question from another question, native SQL query

Can you also try other versions between 1.0.1 and 1.3.1 to narrow down when the bug was introduced?

@ampersand-five
Copy link
Author

ampersand-five commented Jun 18, 2024

python = "3.10"
dbt-snowflake = "1.7.1"
dbt-metabase = "1.3.1"
dbt-core = "1.7.6"

  1. Metabase 1.49.14
  2. Snowflake
  3. A full exposure dump, so all of them? We have everything in our Metabase, the exposure file ends up ~15k lines.

Other versions:

  • Dependencies work in dbt-metabase 1.0.3 for me. After that, the dependencies stop populating in 1.1.0

@gouline
Copy link
Owner

gouline commented Jun 19, 2024

Dependencies work up to dbt-metabase 1.1.0 for me. After that, the dependencies stop populating.

Are you saying 1.1.0 is the last version working or the first version not working?

I can't reproduce your problem with the sandbox project running the same versions of dbt, Metabase and Snowflake, not sure what's different about your environment.

Assuming 1.1.0 is where it started though, #228 seems like the most likely culprit. Here's my blind attempt at reverting that change in #262, can you try installing that branch and see if that fixes it?

pip install git+ssh://git@github.com/gouline/dbt-metabase.git@fix/260

@gouline gouline added the bug Something isn't working label Jun 19, 2024
@ampersand-five
Copy link
Author

Oh I see, that's not clear. I edited my response. It works in 1.0.3, but in the next release of 1.1.0 it does not work.

I'll try that branch.

@ampersand-five
Copy link
Author

That did not fix it.

@ampersand-five
Copy link
Author

ampersand-five commented Jun 19, 2024

🤔 I'm having a different error on 1.0.3 now, that, you tell me, if this new error I have, is related to the missing dependencies error or not:

dbt-metabase exposures runs fine (when I'm using dbt-metabase 1.0.3) with dependencies populated, but when I run dbt docs generate I get an error where:

Exposure 'exposure.ex.__b_example__data' (models/exposures/exposures.yml) depends on a source named 'example_db_b.example_table' which was not found

This error, I think, is because:
I have three databases connected in Metabase, let's say database A, B and C. I have dbt configured to only look at database A. In Metabase we have custom SQL questions written for all three. This error is failing on a question in Metabase that is written for database b, which is not in dbt's output because I only have it on database a.

Is this related or different? If it's different I'll make a new issue.

@gouline
Copy link
Owner

gouline commented Jun 20, 2024

Not much I can do without being able to reproduce this, unfortunately. See if you can write a query that exhibits your 1.3.1 issue against the sandbox project or your own minimal sample project that you can share as a repository (removing anything proprietary), then I can have a look.

@gouline
Copy link
Owner

gouline commented Jun 21, 2024

To help you troubleshoot, I created a debug branch exposure-depends-dump to try. This writes dependencies missing from the dbt model lookup as unknown('table') in the exposure YAML and dumps those lookups in debug.yml:

  • If depends_on are still empty, that means it's not extracting table names from your questions
  • If there are unknowns, that means it can't find dbt models corresponding to the extracted tables in your manifest
pip install git+ssh://git@github.com/gouline/dbt-metabase.git@exposure-depends-dump

@gouline gouline closed this as not planned Won't fix, can't repro, duplicate, stale Jul 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants