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] use new model.batch context vars #1258

Merged
merged 6 commits into from
Dec 5, 2024

Conversation

MichelleArk
Copy link
Contributor

@MichelleArk MichelleArk commented Nov 27, 2024

resolves #1263
docs dbt-labs/docs.getdbt.com/#

Problem

With the introduction of the new batch context variable in dbt-core==1.9.0rc2, it is recommended to use batch.event_time_start and batch.event_time_end over node.config.__dbt_internal.* variables.

Solution

copy+replace, with safe access of model.batch property

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

@cla-bot cla-bot bot added the cla:yes label Nov 27, 2024
Copy link
Contributor

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 dbt-snowflake contributing guide.

1 similar comment
Copy link
Contributor

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 dbt-snowflake contributing guide.

Copy link
Contributor

@QMalcolm QMalcolm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have one concern about the new pattern 🤔

@MichelleArk MichelleArk requested a review from QMalcolm December 2, 2024 14:53
Copy link
Contributor

@QMalcolm QMalcolm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@MichelleArk MichelleArk marked this pull request as ready for review December 5, 2024 20:05
@MichelleArk MichelleArk requested a review from a team as a code owner December 5, 2024 20:05
@MichelleArk MichelleArk merged commit 457c361 into main Dec 5, 2024
14 checks passed
@MichelleArk MichelleArk deleted the use-new-batch-context-vars branch December 5, 2024 21:42
github-actions bot pushed a commit that referenced this pull request Dec 5, 2024
colin-rogers-dbt pushed a commit that referenced this pull request Dec 9, 2024
(cherry picked from commit 457c361)

Co-authored-by: Michelle Ark <[email protected]>
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 node.config.__dbt_internal_* usage to new batch.* context variables
3 participants