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

Incomplete SQL compiled in dbt 0.20.0b1 #3317

Closed
1 of 5 tasks
swiffer opened this issue May 4, 2021 · 1 comment · Fixed by #3318
Closed
1 of 5 tasks

Incomplete SQL compiled in dbt 0.20.0b1 #3317

swiffer opened this issue May 4, 2021 · 1 comment · Fixed by #3318
Assignees
Labels
bug Something isn't working

Comments

@swiffer
Copy link

swiffer commented May 4, 2021

Describe the bug

Running dbt compile results in partly incomplete sql generated where WITH() clauses are missing for ephemeral models when the table to built is also ephemeral

Steps To Reproduce

with colors_flat.sql as

{{
    config(
        materialized='ephemeral'
    )
}}

with colors as (
    select * from {{ ref('base_colors') }}
),

colorclassifications as (
    select * from {{ ref('base_colorclassifications') }} where is_leaf
)

select * from ....

gets compiled to

with colors as (
    select * from __dbt__cte__base_colors
),

colorclassifications as (
    select * from __dbt__cte__base_colorclassifications where is_leaf
)

where base_colors and base_colorclassifications are ephemeral models as well.

Expected behavior

The compiled SQL for __dbt__cte__base_colors and __dbt__cte__base_colorclassifications is missing, it should be inlined instead

Screenshots and log output

If applicable, add screenshots or log output to help explain your problem.

System information

Which database are you using dbt with?

  • postgres
  • redshift
  • bigquery
  • snowflake
  • other (specify: ____________)

The output of dbt --version:

installed version: 0.20.0-b1
   latest version: 0.19.1

Your version of dbt is ahead of the latest release!

Plugins:
  - snowflake: 0.20.0b1

The operating system you're using:
Windows 10

The output of python --version:
Python 3.9.4

Additional context

Add any other context about the problem here.

@swiffer swiffer added bug Something isn't working triage labels May 4, 2021
@kwigley
Copy link
Contributor

kwigley commented May 4, 2021

This is addressed by #3056, but it looks like the fix only made it in 0.19.*! I will pull the fix over into the current development branch and include in the next release. Thank you for testing the beta and catching this @swiffer!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants