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

Refactor to use new batch context varaibles #967

Merged
merged 2 commits into from
Dec 12, 2024

Conversation

QMalcolm
Copy link
Contributor

resolves #966

Problem

During the betas/rcs of dbt-core 1.9.0, the varaibles __dbt_internal_event_time_start and __dbt_internal_event_time_end were available on the model in the jinja context. However when the final of dbt-core 1.9.0 was released, dbt-core started providing a batch object on the model available in the jinja context. This batch object made availble all the prevous information and more, and it is the "correct" way to get the information (i.e. __dbt_internal_event_time_end and __dbt_internal_event_time_start are deprecated.

Solution

Update the microbatch incremental strategies to use model.batch.<variable> variables

Checklist

  • I have read the contributing guide and understand what's expected of me
  • I have run this code in development and it appears to resolve the stated issue
  • This PR includes tests, or tests are not required/relevant for this PR
  • This PR has no interface changes (e.g. macros, cli, logs, json artifacts, config files, adapter interface, etc) or this PR has already received feedback and approval from Product or DX

During the betas/rcs of dbt-core 1.9.0, the varaibles `__dbt_internal_event_time_start` and `__dbt_internal_event_time_end` were available on the model in the jinja context. However when the final of dbt-core 1.9.0 was released, dbt-core started providing a `batch` object on the model available in the jinja context. This batch object made availble all the prevous information and more, and it is the "correct" way to get the information (i.e. `__dbt_internal_event_time_end` and `__dbt_internal_event_time_start` are deprecated.
@QMalcolm QMalcolm requested a review from a team as a code owner December 11, 2024 20:52
@cla-bot cla-bot bot added the cla:yes label Dec 11, 2024
@QMalcolm QMalcolm enabled auto-merge (squash) December 11, 2024 22:58
@QMalcolm QMalcolm merged commit 0376909 into main Dec 12, 2024
29 checks passed
@QMalcolm QMalcolm deleted the qmalcolm--refactor-to-use-new-batch-context-variables branch December 12, 2024 04:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor dbt-redshift to use batch context object instead of __dbt_internal variables
3 participants