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

Specify models #2811

Open
zoltanmihaly opened this issue Jun 24, 2024 · 2 comments
Open

Specify models #2811

zoltanmihaly opened this issue Jun 24, 2024 · 2 comments

Comments

@zoltanmihaly
Copy link

zoltanmihaly commented Jun 24, 2024

I've tried to use SQLMesh on a dbt project but got the following error when launching the UI:

image

It'd be great if the error logs would specify the exact models that are causing the circular references the same way dbt does, for example: RuntimeError: Found a cycle: model.dbt_cyclical_project.model_a --> model.dbt_cyclical_project.model_b

I didn't get the circular references error when running the same models with dbt instead of SQLMesh, so it'd be great for me to understand what models are causing an error in SQLMesh but not in dbt

@georgesittas
Copy link
Contributor

Hey @zoltanmihaly,

This error message should generally contain the models that produced the cycle, or at least an estimate - see https://github.com/TobikoData/sqlmesh/blob/main/sqlmesh/utils/dag.py#L134-L138. Can you check the stack trace / logs to see if there's additional info in there?

It would also be helpful if you could share a reproducible example.

@izeigerman
Copy link
Member

izeigerman commented Jun 27, 2024

@zoltanmihaly most likely one of the models has a dbt test (audit in SQLMesh terms) which references a model downstream.

Unlike dbt, SQLMesh audits are part of the model evaluation and not a separate step. That's why a cyclic reference in an audit leads to a failure in SQLMesh but not dbt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants