-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[Bug] Trying to compile model in comments #11181
Comments
Thank you for your bug report! Our team is will be out of the office for Christmas and our Global Week of Rest, from December 25, 2024, through January 3, 2025. We will review your issue as soon as possible after returning. If you are a customer of dbt Cloud, please contact our Customer Support team via the dbt Cloud web interface or email [email protected]. |
Apparently not a bug, see: #11181 (comment) |
This is expected AFAIK based on https://docs.getdbt.com/reference/dbt-jinja-functions/ref#forcing-dependencies However dbt is parsing refs it just completely ignores comments. |
@tayloramurphy hit the nail on the head: what you are seeing is not a bug, and https://docs.getdbt.com/reference/dbt-jinja-functions/ref#forcing-dependencies is an example of how it is actually a feature used by dbt to give hints to build out the DAG. If you need/want to comment out some code, you can replace select 1 as id
-- from { { ref("nonexistent_model") }} This will prevent it from being recognized as Jinja that needs to be templated. |
Is this a new bug in dbt-core?
Current Behavior
When compiling a model with a reference to another model in the comments, it gives a standard model missing error, and will not compile. "Compilation Error in model ... ... depends on a node named"
Note: Dialect is T-SQL
Note: using Azure Dedicated Pools adapter (Azure DW)
Note: commented using "--" style and not "{#" style
Expected Behavior
I expect the model compiler to disregard anything in comments e.g. references.
Steps To Reproduce
Relevant log output
No response
Environment
Which database adapter are you using with dbt?
other (mention it in "Additional Context")
Additional Context
Azure Dedicated Pools adapter
The text was updated successfully, but these errors were encountered: