Skip to content

fix: check sqlmesh version before sqlglot/schema #4898

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 3, 2025

Conversation

eakmanrq
Copy link
Contributor

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

@Copilot 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):

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

2 participants