Skip to content

fix: check sqlmesh version before sqlglot/schema#4898

Merged
eakmanrq merged 1 commit intomainfrom
eakmanrq/check_sqlmesh_version_first
Jul 3, 2025
Merged

fix: check sqlmesh version before sqlglot/schema#4898
eakmanrq merged 1 commit intomainfrom
eakmanrq/check_sqlmesh_version_first

Conversation

@eakmanrq
Copy link
Copy Markdown
Collaborator

@eakmanrq eakmanrq commented Jul 3, 2025

Prior to this PR, if a user was running a version that didn't match the remote SQLMesh version, they would likely see a schema or sqlglot version mismatched error before SQLMesh. Erroring on SQLMesh is more useful since it makes it more clear what the issue is - version/SQLGLot should just be backup checks.

@eakmanrq eakmanrq requested a review from Copilot July 3, 2025 21:03
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Reorders version mismatch checks to prioritize SQLMesh version before schema and SQLGlot, and removes a duplicate SQLMesh check.

  • Moves the SQLMesh version validation to occur immediately after the remote version fetch.
  • Deletes the redundant SQLMesh version check block that followed schema/SQLGlot checks.
Comments suppressed due to low confidence (2)

sqlmesh/core/state_sync/base.py:248

  • Add unit tests to cover the new early SQLMesh version mismatch path to ensure this scenario is properly tested.
            if major_minor(SQLMESH_VERSION) != major_minor(versions.sqlmesh_version):

Comment thread sqlmesh/core/state_sync/base.py
@eakmanrq eakmanrq force-pushed the eakmanrq/check_sqlmesh_version_first branch from 7f96dab to 6ce8efc Compare July 3, 2025 21:33
@eakmanrq eakmanrq merged commit 6c98222 into main Jul 3, 2025
27 checks passed
@eakmanrq eakmanrq deleted the eakmanrq/check_sqlmesh_version_first branch July 3, 2025 23:34
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.

3 participants