Repository navigation
fix(schema_loader): quote case-sensitive column names in external models - #6099
Open
ReguiguiMohamed wants to merge 1 commit into
Open
ReguiguiMohamed wants to merge 1 commit into
ReguiguiMohamed wants to merge 1 commit into
Conversation
create_external_models wrote column names bare, so a Postgres column "ID" was read back as id. A name is now quoted only when the loader's identifier normalization would change it. Names that already round-trip are written as before. Before the fix the new test failed with '"ID"' != 'ID' on Postgres and '"lower_case"' != 'lower_case' on Snowflake. Fixes SQLMesh#6058 Signed-off-by: ReguiguiMohamed <mohamedreguigui2004@gmail.com>
ReguiguiMohamed
force-pushed
the
fix/external-models-quote-case-sensitive-columns
branch
from
October 28, 2026 23:18
0f21647 to
ae50f5b
Compare
Contributor
Author
|
Rebased on main, since the CI runs expired before they were approved. @StuffbyYuki, could you approve the workflows and take a look when you have time? |
Contributor
|
Figured I would add some context, since this fix overlaps with work I tried earlier. I opened a very similar change for quoting case-sensitive column names in external models on 12 September 2026 (#6059). It got no maintainer response, so I sent a polite check-in on 21 September 2026, and the thread stayed silent. My automated dormancy workflow closes pull requests that stay inactive that long, so it closed #6059 on 23 September 2026 at 19:36 UTC. I am glad to see this one up and hope it gets the attention it deserves. |
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
Preserve column names when generating external models. PostgreSQL
"ID"was loaded asid.Builds on @devtechedge's closed PR #6059, using SQLGlot identifier serialization and adding Snowflake and ClickHouse coverage.
Fixes #6058
Test Plan
test_create_external_models_quotes_case_sensitive_columnscovers Postgres, Snowflake and ClickHouse. It checks the written keys and the round trip throughcreate_external_model.pytest tests/core/test_schema_loader.py: 11 passedpytest tests/core/test_model.py -k external: 4 passedpytest tests/core/linter/test_builtin.py tests/lsp tests/core/test_schema_loader.py -m "not slow and not docker": 76 passedChecklist
make styleand fixed any issues (ranmake py-stylein WSL, covering every configured hook)make fast-test)git commit -s) per the DCOSummary by CodeRabbit