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 a dbt project that uses the dbt_utils.star macro that will not pass sqlfluff linting checks because the table that star is pointing at doesn’t exist yet. The current behavior of the macro is to return nothing in this situation, but it creates compiled code that looks like this:
select
from tablename
Code like this causes sqlfluff to raise a parsing error.
Steps to reproduce
Create some_model.sql like:
select
{{ dbt_utils.star(from=ref('some_table'), except=['some_column']) }}
from ref('some_table')
Make sure it doesn't exist yet:
drop table {{ ref('some_table') }}
Run dbt compile
Check the compiled SQL in target/compiled/{PROJECT_NAME}/models/some_model.sql
Expected results
select
*
from tablename
Actual results
select
from tablename
Workaround
dbt run before linting (not ideal)
The text was updated successfully, but these errors were encountered:
Describe the bug
Previously raised by @swanjson here and again by sam I here:
Steps to reproduce
some_model.sql
like:dbt compile
target/compiled/{PROJECT_NAME}/models/some_model.sql
Expected results
Actual results
Workaround
dbt run
before linting (not ideal)The text was updated successfully, but these errors were encountered: