Skip to content

Commit 767755e

Browse files
Fix: Pop select model in tablediff to ensure backwards compatibility (#4325)
1 parent 4772446 commit 767755e

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

sqlmesh/cli/main.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from sqlmesh.core.config import load_configs
1818
from sqlmesh.core.context import Context
1919
from sqlmesh.utils.date import TimeLike
20-
from sqlmesh.utils.errors import MissingDependencyError
20+
from sqlmesh.utils.errors import MissingDependencyError, SQLMeshError
2121
from pathlib import Path
2222

2323
logger = logging.getLogger(__name__)
@@ -907,7 +907,14 @@ def table_diff(
907907
) -> None:
908908
"""Show the diff between two tables or a selection of models when they are specified."""
909909
source, target = source_to_target.split(":")
910-
select_models = {model} if model else kwargs.pop("select_model", None)
910+
select_model = kwargs.pop("select_model", None)
911+
912+
if model and select_model:
913+
raise SQLMeshError(
914+
"The --select-model option cannot be used together with a model argument. Please choose one of them."
915+
)
916+
917+
select_models = {model} if model else select_model
911918
obj.table_diff(
912919
source=source,
913920
target=target,

0 commit comments

Comments
 (0)