Conversation
Signed-off-by: mday-io <mdaytn@gmail.com>
mday-io
force-pushed
the
mday/preserve-unselected-external-hashes
branch
from
September 25, 2026 21:26
32bb25f to
6731332
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
A selected plan can refresh schemas for a downstream model that has an unselected external co-parent. The refresh can recompute that external model's cached hash even though the model was sourced unchanged from the target environment. The plan then reports a direct external change and indirect downstream changes that were not selected.
Preserve the deployed data and metadata hashes for an unselected external model when schema refresh leaves its serialized definition unchanged. Selected external edits and selected dependency schema changes remain visible.
The regression test injects an inconsistent persisted hash to exercise this invariant. It does not claim that a normal SQLMesh migration creates that state.
Test Plan
pytest -q tests/core/test_selector_native.py: 42 passed.pytest -q tests/core/test_selector_dbt.py: 6 passed.pytest -q tests/core/integration/test_plan_options.py -k test_select_models: 3 passed.git diff --checkpassed.make stylecould not complete locally because this checkout lacks generatedsqlmesh._versionandhttpx2imports. The new test's typing errors were fixed; targeted mypy reports only the missing generated version imports.make fast-testreached about 97% of its first 2,584-test group without a displayed failure, then hit a 180-second local cap. The remaining groups have not run.Checklist
make styleand fixed any issuesmake fast-test)git commit -s) per the DCO