Skip to content

Add object to context with compiled code for full refresh #11383

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

b-per
Copy link
Contributor

@b-per b-per commented Mar 11, 2025

Part of the solution to resolve dbt-labs/dbt-adapters#154

Needs to be released along with dbt-labs/dbt-adapters#900 for the materialization code.

Problem

Today it is not possible to set on_schema_change = full_refresh for incremental models.

Solution

To make it possible to add the feature, this implementation adds an object called sql_full_refresh to the context so that the materialization macros in dbt-adapters can use this variable.

This prevents having to re-compile the model if we realize that a model should run as a full refresh when its schema changes.

There is no test for now, but I am happy to add some if the approach in this PR along with the dbt-adapters one is OK to be merged.

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 or 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.
  • This PR includes type annotations for new and modified functions.

@b-per b-per requested a review from a team as a code owner March 11, 2025 19:46
@cla-bot cla-bot bot added the cla:yes label Mar 11, 2025
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 contributing guide.

@github-actions github-actions bot added the community This PR is from a community member label Mar 11, 2025
@b-per b-per linked an issue Mar 12, 2025 that may be closed by this pull request
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla:yes community This PR is from a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] "Full Refresh" on_schema_change strategy Support on_schema_change: full_refresh mode
1 participant