Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions sqlmesh/core/state_sync/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,15 @@ def raise_error(
f"{lib} (local) is using version '{local}' which is behind '{remote}' (remote).{upgrade_suggestion}"
)

if major_minor(SQLMESH_VERSION) != major_minor(versions.sqlmesh_version):
raise_error(
"SQLMesh",
SQLMESH_VERSION,
versions.sqlmesh_version,
remote_package_version=versions.sqlmesh_version,
ahead=major_minor(SQLMESH_VERSION) > major_minor(versions.sqlmesh_version),
Comment thread
eakmanrq marked this conversation as resolved.
)

if SCHEMA_VERSION != versions.schema_version:
raise_error(
"SQLMesh",
Expand All @@ -263,15 +272,6 @@ def raise_error(
ahead=major_minor(SQLGLOT_VERSION) > major_minor(versions.sqlglot_version),
)

if major_minor(SQLMESH_VERSION) != major_minor(versions.sqlmesh_version):
raise_error(
"SQLMesh",
SQLMESH_VERSION,
versions.sqlmesh_version,
remote_package_version=versions.sqlmesh_version,
ahead=major_minor(SQLMESH_VERSION) > major_minor(versions.sqlmesh_version),
)

return versions

@abc.abstractmethod
Expand Down
2 changes: 1 addition & 1 deletion tests/core/state_sync/test_state_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -2091,7 +2091,7 @@ def test_version_schema(state_sync: EngineAdapterStateSync, tmp_path) -> None:

with pytest.raises(
SQLMeshError,
match=rf"SQLMesh \(local\) is using version '{SCHEMA_VERSION}' which is ahead of '0'",
match=rf"SQLMesh \(local\) is using version '{SQLMESH_VERSION}' which is ahead of '0.0.0' \(remote\). Please run a migration \('sqlmesh migrate' command\).",
):
state_sync.get_versions()

Expand Down