Skip to content

fix(engine_adapter): preserve pre_ping in with_settings - #5922

Merged
StuffbyYuki merged 1 commit into
SQLMesh:mainfrom
Sanjays2402:fix/with-settings-preserve-pre-ping
Aug 6, 2026
Merged

fix(engine_adapter): preserve pre_ping in with_settings#5922
StuffbyYuki merged 1 commit into
SQLMesh:mainfrom
Sanjays2402:fix/with-settings-preserve-pre-ping

Conversation

@Sanjays2402

@Sanjays2402 Sanjays2402 commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Closes #5912.

Description

EngineAdapter.with_settings() did not forward the current _pre_ping value to the cloned adapter, and the constructor defaults pre_ping to False. Context.snapshot_evaluator clones the adapter this way, so pre_ping: true silently did not apply to model evaluation or the before_all/after_all environment statements. pre_ping is now carried over like the other settings, and stays overridable via an explicit keyword argument.

Test Plan

New test_with_settings_preserves_pre_ping in tests/core/engine_adapter/test_base.py (next to the existing test_pre_ping); it fails on main and passes with the fix. tests/core/engine_adapter/test_base.py passes (122 tests).

Checklist

  • I have run ruff check / ruff format on the changed files
  • I have added tests for my changes (if applicable)
  • All existing tests in tests/core/engine_adapter/test_base.py pass (122)
  • My commits are signed off (git commit -s) per the DCO

EngineAdapter.with_settings() did not forward the current _pre_ping
value to the cloned adapter, and the constructor defaults pre_ping to
False. Context.snapshot_evaluator clones the adapter this way, so
pre_ping: true silently did not apply to model evaluation or the
before_all/after_all environment statements, and a stale connection
after a long run failed instead of being re-established.

pre_ping is now carried over like the other settings, and remains
overridable via an explicit keyword argument.

Adds a regression test asserting the cloned adapter keeps pre_ping.

Signed-off-by: Sanjay Santhanam <51058514+Sanjays2402@users.noreply.github.com>
@StuffbyYuki
StuffbyYuki force-pushed the fix/with-settings-preserve-pre-ping branch from 6b27193 to f9feb8b Compare August 4, 2026 05:45
@StuffbyYuki
StuffbyYuki merged commit 32b0a32 into SQLMesh:main Aug 6, 2026
32 checks passed
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.

EngineAdapter.with_settings() drops pre_ping when creating the SnapshotEvaluator adapter

2 participants