You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched the existing issues, and I could not find an existing issue for this bug
Current Behavior
I'm trying unit tests with a model that has a couple run_query macro calls. I found that this macro causes the unit test to fail with a SQL compilation error. This model can be run without the unit test and it will compile correctly.
002003 (42S02): SQL compilation error:
Object '__DBT__CTE__BASE_TABLE' does not exist or not authorized.
Here's a simple model and unit test which will produce this error.
simple_test_model.sql:
{% set query %}
SELECTmax(created_at)
from {{ ref('base_table') }}
{% endset %}
{% set max_date = run_query(query) %}
select*from {{ ref('base_table') }}
Is this a new bug in dbt-core?
Current Behavior
I'm trying unit tests with a model that has a couple
run_query
macro calls. I found that this macro causes the unit test to fail with a SQL compilation error. This model can be run without the unit test and it will compile correctly.Here's a simple model and unit test which will produce this error.
simple_test_model.sql
:Unit test:
Expected Behavior
Expect the unit test to succeed (or at least not crash)
Steps To Reproduce
simple_test_model.sql
using example model above.dbt test --select simple_test_model
Relevant log output
No response
Environment
Which database adapter are you using with dbt?
snowflake
Additional Context
No response
The text was updated successfully, but these errors were encountered: