Skip to content

Commit 445c775

Browse files
committed
proper test
1 parent acfeea0 commit 445c775

1 file changed

Lines changed: 11 additions & 16 deletions

File tree

tests/core/engine_adapter/test_fabric.py

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
from sqlmesh.core.engine_adapter import FabricEngineAdapter
1010
from tests.core.engine_adapter import to_sql_calls
1111
from sqlmesh.core.engine_adapter.shared import DataObject
12-
from sqlmesh.core.schema_diff import TableAlterOperation
1312

1413
pytestmark = [pytest.mark.engine, pytest.mark.fabric]
1514

@@ -96,23 +95,19 @@ def test_alter_table_is_noop(adapter: FabricEngineAdapter):
9695
Tests that alter_table is a no-op for Fabric.
9796
9897
The adapter should not execute any SQL, signaling to the caller
99-
that it should use a fallback strategy (like drop/recreate)
98+
that it should use the fallback strategy (like drop/add)
10099
to apply schema changes.
101100
"""
102-
adapter.alter_table(
103-
[
104-
TableAlterOperation(
105-
expression=exp.AlterTable(
106-
this=exp.to_table("test_table"),
107-
actions=[
108-
exp.AddColumn(
109-
this=exp.to_column("new_col"),
110-
def_col_type=exp.DataType(this=exp.DataType.Type.INT),
111-
)
112-
],
113-
)
101+
alter_expression = exp.Alter(
102+
this=exp.to_table("test_table"),
103+
actions=[
104+
exp.ColumnDef(
105+
this=exp.to_column("new_col"),
106+
kind=exp.DataType(this=exp.DataType.Type.INT),
114107
)
115-
]
108+
],
116109
)
117110

118-
adapter.cursor.execute.assert_not_called()
111+
adapter.alter_table([alter_expression])
112+
113+
adapter.cursor.execute.assert_not_called()

0 commit comments

Comments
 (0)