-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Remove injected_sql. Store non-ephemeral injected_sql in compiled_sql #2834
Conversation
2339c5b
to
8be9825
Compare
8be9825
to
512c41d
Compare
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.
I took this for a spin locally and tried a bunch of hacky things with ephemeral models and dynamic templating (via run_query
). The compiled_sql
in the manifest looks good every time.
Really happy to see all the code comments in compilation.py
! I can actually follow what's happening.
After we merge this and before a v0.19 prerelease, we'll want to merge the corresponding dbt-docs PR: dbt-labs/dbt-docs#148
self.assertGreaterEqual(result[1].replace(tzinfo=pytz.UTC), self._invalidated_snapshot_datetime) | ||
# there are milliseconds (part of microseconds in datetime objects) in the | ||
# invalidated_snapshot_datetime and not in result datetime so set the microseconds to 0 | ||
self.assertGreaterEqual(result[1].replace(tzinfo=pytz.UTC), self._invalidated_snapshot_datetime.replace(microsecond=0)) |
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.
nice catch
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.
Thanks for being patient with me! This looks great, just one small stylistic question
resolves #2762
Description
The 'injected_sql' field in the manifest nodes is confusing, since it's another form of compiled_sql. The injected_sql field is used internally in compiling ephemeral nodes. This code removed injected_sql from the classes and artifacts, and copies it into 'compiled_sql' for executable nodes. Ephemeral nodes will retain their original 'compiled_sql', since it didn't work to overwrite compiled_sql with injected_sql for those nodes. Since ephemeral nodes do not show up in executable SQL files, this will not hopefully be an issue.
Checklist
CHANGELOG.md
and added information about my change to the "dbt next" section.