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
Describe the bug
check-script-has-no-table-name fails with subqueries referencing CTEs if there is no space between the CTE name and the closing parenthesis .
To Reproduce
The following fails with the error models/staging/intermediate/assets_enriched.sql: does not use source() or ref() macros for tables: - asset_category)
with assets as (
select * from {{ ref('stg_rse__assets') }}
),
asset_category as (
select * from {{ ref('data_asset_category') }}
),
final as (
select
assets.*,
case
when assets.category = 'cars' then assets.category
when assets.category = 'wine-spirits' then assets.category
when assets.ticker in (select ticker from asset_category) then asset_category.asset_category
else 'unknown'
end as asset_category
from assets
left join asset_category using (ticker)
)
select * from final
Changing the subquery on line 15 to (select ticker from asset_category ), essentially adding a space between the CTE name and closing parenthesis fixes the issue, but breaks the SQL style guide.
Version:
v0.1.1 bleeding edge
The text was updated successfully, but these errors were encountered:
Thanks again @MartinGuindon for reporting this bug. Think I fixed that. Once again it is only in bleeding edge version. Hopefully I will release new version soon, since I have added some new hooks :D. To upgrade to bleeding edge - pre-commit autoupdate --bleeding-edge
Describe the bug
check-script-has-no-table-name fails with subqueries referencing CTEs if there is no space between the CTE name and the closing parenthesis .
To Reproduce
The following fails with the error
models/staging/intermediate/assets_enriched.sql: does not use source() or ref() macros for tables: - asset_category)
Changing the subquery on line 15 to
(select ticker from asset_category )
, essentially adding a space between the CTE name and closing parenthesis fixes the issue, but breaks the SQL style guide.Version:
v0.1.1 bleeding edge
The text was updated successfully, but these errors were encountered: