-
Notifications
You must be signed in to change notification settings - Fork 112
Implement full refresh preview option #1671
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
base: master
Are you sure you want to change the base?
Implement full refresh preview option #1671
Conversation
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Pull Request Overview
Adds a new “full refresh” preview mode by introducing a previewFullRefresh
setting and threading a fullRefresh
flag through all compile and execution code paths.
- Exposes
dbt.previewFullRefresh
in package.json and reads it in the client. - Updates TypeScript interfaces and implementations (core, command, cloud) to accept and pass
fullRefresh
. - Extends Python integration to temporarily toggle
full_refresh
duringcompile_sql
andexecute_sql
.
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
src/manifest/dbtProject.ts | Retrieve previewFullRefresh and pass fullRefresh to methods |
src/dbt_client/dbtIntegration.ts | Add fullRefresh to interface signatures |
src/dbt_client/dbtCoreIntegration.ts | Pass flag into core Python bridge calls |
src/dbt_client/dbtCoreCommandIntegration.ts | Append --full-refresh in CLI commands if flag is true |
src/dbt_client/dbtCloudIntegration.ts | Mirror full-refresh flag handling for dbt Cloud |
package.json | Define new dbt.previewFullRefresh configuration schema |
dbt_core_integration.py | Add and restore full_refresh in Python execute_sql /compile_sql |
Comments suppressed due to low confidence (2)
src/manifest/dbtProject.ts:851
- [nitpick] The
previewFullRefresh
setting is fetched in multiple methods; extract this into a helper (e.g.,getFullRefreshSetting()
) to reduce duplication and improve readability.
const fullRefresh = workspace.getConfiguration("dbt").get<boolean>("previewFullRefresh", false);
src/manifest/dbtProject.ts:851
- There are no tests covering the new
previewFullRefresh
flag; add unit tests to verify that bothunsafeCompileQuery
andexecuteSQL
respect the setting.
const fullRefresh = workspace.getConfiguration("dbt").get<boolean>("previewFullRefresh", false);
@@ -216,6 +216,11 @@ | |||
"default": 500, | |||
"minimum": 1 | |||
}, | |||
"dbt.previewFullRefresh": { |
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.
[nitpick] Document the new dbt.previewFullRefresh
setting in the project README or changelog so users know about and can configure the full-refresh preview mode.
Copilot uses AI. Check for mistakes.
@@ -674,21 +678,28 @@ def execute_macro( | |||
"""Wraps adapter execute_macro. Execute a macro like a function.""" | |||
return self.get_macro_function(macro, compiled_code)(kwargs=kwargs) | |||
|
|||
def execute_sql(self, raw_sql: str, original_node: Optional[Union["ManifestNode", str]] = None) -> DbtAdapterExecutionResult: | |||
def execute_sql(self, raw_sql: str, original_node: Optional[Union["ManifestNode", str]] = None, full_refresh: bool = False) -> DbtAdapterExecutionResult: | |||
"""Execute dbt SQL statement against database""" |
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.
The execute_sql
method's docstring doesn't mention the new full_refresh
parameter; update the docstring to explain how this flag alters execution behavior.
"""Execute dbt SQL statement against database""" | |
"""Execute dbt SQL statement against the database. | |
Args: | |
raw_sql (str): The raw SQL statement to execute. | |
original_node (Optional[Union["ManifestNode", str]]): The original node associated with the SQL, if any. | |
full_refresh (bool): If True, forces a full refresh of incremental models by setting the `full_refresh` | |
flag in the execution context. This temporarily overrides the `self.args.full_refresh` attribute. | |
Returns: | |
DbtAdapterExecutionResult: The result of the SQL execution, including raw and compiled SQL. | |
""" |
Copilot uses AI. Check for mistakes.
Summary
dbt.previewFullRefresh
setting to allow full-refresh previewfullRefresh
flag from dbt project when compiling or executing SQLfull_refresh
when compiling/executingTesting
npm test