-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Fix compiled_code
, reimplement sql
as wrapper
#9503
Conversation
Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the contributing guide. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #9503 +/- ##
==========================================
- Coverage 88.03% 88.01% -0.03%
==========================================
Files 167 167
Lines 22130 22126 -4
==========================================
- Hits 19482 19474 -8
- Misses 2648 2652 +4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
def sql(self) -> Optional[str]: | ||
# only set this for sql models, for backward compatibility | ||
if self.model.language == ModelLanguage.sql: # type: ignore[union-attr] | ||
return self.compiled_code |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I'm following the logic correctly, I think this previously resulted in self.model.compiled_code
. I want to make sure this is intentional since both are syntactically correct.
🎩 Confirmed this fix locally by running an incremental model on Before: On model.my_project.my_model: /* {"app": "dbt", "dbt_version": "1.8.0a1", "profile_name": "snowflake", "target_name": "dev", "node_id": "model.my_project.my_model"} */
create or replace transient table analytics_dev.dbt_jcohen.my_model
as
(select * from analytics.analytics.my_model
); After: On model.my_project.my_model: /* {"app": "dbt", "dbt_version": "1.8.0a1", "profile_name": "snowflake", "target_name": "dev", "node_id": "model.my_project.my_model"} */
create or replace transient table analytics_dev.dbt_jcohen.my_model
as
(
... tons of SQL ...
); |
resolves #9502
Problem
merge_from_artifact
& support all commands #9040 addeddefer_relation
to all nodes any time--defer
was providedclone
command that depended on the presence ofdefer_relation
merge_from_artifact
& support all commands #9040 updated this logic forsql
context member, but not forcompiled_code
Solution
compiled_code
context membersql
context member as a wrapper aroundcompiled_code
, to prevent future divergenceChecklist