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

[CT-2947] [Bug] Ephemeral model should refresh when a new column is added #8334

Closed
2 tasks done
BrJan opened this issue Aug 7, 2023 · 3 comments
Closed
2 tasks done
Labels
bug Something isn't working

Comments

@BrJan
Copy link

BrJan commented Aug 7, 2023

Is this a new bug in dbt-core?

  • I believe this is a new bug in dbt-core
  • I have searched the existing issues, and I could not find an existing issue for this bug

Current Behavior

Compiled code:
with __dbt_cte_ephemeral_model as ( select * from some_source_model ) with primary_upstream_model as (select * from upstream_model) , ephemeral_model as (select * from __dbt_cte_ephemeral_model) select * from primary_upstream_model

Expected Behavior

Compiled code:
with __dbt_cte_ephemeral_model as ( select * from some_source_model ) , primary_upstream_model as (select * from upstream_model) , ephemeral_model as (select * from __dbt_cte_ephemeral_model) select * from primary_upstream_model

Steps To Reproduce

Run this:
with primary_upstream_model as (select * from upstream_model) , ephemeral_model as (select * from ephemeral_model) select * from primary_upstream_model

Relevant log output

No response

Environment

- OS:
- Python:
- dbt:

Which database adapter are you using with dbt?

No response

Additional Context

The root seems to be that when DBT compiles an ephemeral model, it should adjust the rest of the model imports to account for the added CTE.

A full refresh should happen whenever a column is added; it also shouldn't fail as an invalid identifier.

@BrJan BrJan added bug Something isn't working triage labels Aug 7, 2023
@github-actions github-actions bot changed the title [Bug] Ephemeral model should refresh when a new column is added [CT-2947] [Bug] Ephemeral model should refresh when a new column is added Aug 7, 2023
@dbeatty10
Copy link
Contributor

Thanks for reaching out @BrJan !

Could you share the following?

  • an example source code for an ephemeral model that leads to this problem
  • dbt commands you are using
  • the database adapter you are using (e.g., bigquery, snowflake, databricks, etc)

@dbeatty10
Copy link
Contributor

Also, which version of dbt are you seeing this in?

I just remembered this looks like #8213 and #8217 which were fixed in dbt-core 1.5.4

@jeremyyeo
Copy link
Contributor

This is resolved - I think Brian opened up an accidental dupe since the customers ticket contained 2 issues (the first of which was this, which is fully resolved, the second of which is regarding contracts and thus has nothing to do with this whatsoever).

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

No branches or pull requests

3 participants