Skip to content

fix: stop emitting insert_overwrite noise warning on every run (#1305)#1425

Open
sd-db wants to merge 3 commits intomainfrom
sd-db/fix/suppress-insert-overwrite-warnings
Open

fix: stop emitting insert_overwrite noise warning on every run (#1305)#1425
sd-db wants to merge 3 commits intomainfrom
sd-db/fix/suppress-insert-overwrite-warnings

Conversation

@sd-db
Copy link
Copy Markdown
Collaborator

@sd-db sd-db commented Apr 26, 2026

Summary

Fixes #1305 partially

Every insert_overwrite run on a SQL warehouse was emitting:

insert_overwrite will perform a dynamic insert overwrite. If you depended on the legacy truncation behavior, consider disabling the behavior flag use_replace_on_for_insert_overwrite.

Once a user is on the default use_replace_on_for_insert_overwrite=True, this carries no actionable signal — it just spams the run log on every model.

Change

  • Drop the unconditional warning on the SQL-warehouse + flag-enabled path. SQL warehouses always support REPLACE ON, so there's nothing to warn about.
  • Add a targeted warning for the only case where the flag's intent can't be honored: cluster compute on DBR < 17.1 with use_replace_on_for_insert_overwrite=True. There, the user opted into REPLACE ON but the runtime falls back to legacy INSERT OVERWRITE — that mismatch is worth surfacing.
  • Emitted SQL is unchanged.

Test plan

  • Unit tests cover both new behaviors:
  • Verified locally against a real SQL warehouse: insert_overwrite runs no longer emit the warning. Pre-fix code with the same harness confirmed the warning fired (test failed); fixed code confirmed silence (test passed).
  • TestInsertOverwriteWithPartitionsDelta still passes — no behavioral regression.

Previously, every insert_overwrite run on a SQL warehouse emitted
"insert_overwrite will perform a dynamic insert overwrite..." even
though SQL warehouses always support REPLACE ON. The warning had no
actionable signal once a user opted into the default behavior flag.

Move the warning to the only case where it has signal: cluster compute
on DBR < 17.1 with use_replace_on_for_insert_overwrite=True, where the
user expected REPLACE ON but the runtime can't deliver it and we fall
back to legacy INSERT OVERWRITE.
@github-actions
Copy link
Copy Markdown

Coverage report

This PR does not seem to contain any modification to coverable code.

@sd-db sd-db self-assigned this Apr 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Option to silence warnings for insert_overwrite

1 participant