Skip to content

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

Open
Sanjays2402 wants to merge 1 commit into
SQLMesh:mainfrom
Sanjays2402:fix/with-settings-preserve-pre-ping
Open

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

Conversation

@Sanjays2402

@Sanjays2402 Sanjays2402 commented Jul 26, 2026

Copy link
Copy Markdown

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>
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

1 participant