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

[Bug] Update command-based logic in compiled_code context member, to match sql #9502

Closed
2 tasks done
jtcohen6 opened this issue Feb 1, 2024 · 0 comments · Fixed by #9503
Closed
2 tasks done

[Bug] Update command-based logic in compiled_code context member, to match sql #9502

jtcohen6 opened this issue Feb 1, 2024 · 0 comments · Fixed by #9503
Labels
bug Something isn't working pre-regression Regression not yet in a stable release

Comments

@jtcohen6
Copy link
Contributor

jtcohen6 commented Feb 1, 2024

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

In #9040, we added defer_relation for all tasks that perform deferral.

Previously, there was dynamic routing logic in the sql + compiled_code context members that checked for the existnece of defer_relation and overwrote the "compiled code" to use during clone.

#9040 updated the dynamic routing logic for the sql context member (based on the running task), but not the compiled_code context member.

These need to be the same. Otherwise, I might build a model with deferral and, depending on whether the materialization uses {{ sql }} or {{ compiled_code }}, get a different (inconsistent) result.

Expected Behavior

There should be no difference between {{ sql }} and {{ compiled_code }} for SQL models.

Steps To Reproduce

  1. dbt-core main branch
  2. Use a materialization that calls compiled_code instead of sql, e.g. dbt-snowflake's incremental materialization

Relevant log output

$ dbt build --debug
...
create or replace transient table ANALYTICS_DEV.dbt_jcohen.dim_certification_candidates
         as
        (select * from analytics.analytics.dim_certification_candidates
        );

That ain't right!

Environment

dbt: main

Which database adapter are you using with dbt?

No response

Additional Context

No response

@jtcohen6 jtcohen6 added the bug Something isn't working label Feb 1, 2024
@jtcohen6 jtcohen6 added the pre-regression Regression not yet in a stable release label Feb 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pre-regression Regression not yet in a stable release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant