diff --git a/tests/core/engine_adapter/integration/test_integration.py b/tests/core/engine_adapter/integration/test_integration.py index 3e50cf4da9..ec5c6b4208 100644 --- a/tests/core/engine_adapter/integration/test_integration.py +++ b/tests/core/engine_adapter/integration/test_integration.py @@ -15,6 +15,7 @@ import pytz from sqlglot import exp, parse_one from sqlglot.optimizer.normalize_identifiers import normalize_identifiers +from sqlglot.optimizer.qualify_columns import quote_identifiers from sqlmesh import Config, Context from sqlmesh.cli.project_init import init_example_project @@ -1954,11 +1955,18 @@ def test_sushi(ctx: TestContext, tmp_path_factory: pytest.TempPathFactory): ], personal_paths=[pathlib.Path("~/.sqlmesh/config.yaml").expanduser()], ) - config.before_all = [ + before_all = [ f"CREATE SCHEMA IF NOT EXISTS {raw_test_schema}", f"DROP VIEW IF EXISTS {raw_test_schema}.demographics", f"CREATE VIEW {raw_test_schema}.demographics AS (SELECT 1 AS customer_id, '00000' AS zip)", ] + config.before_all = [ + quote_identifiers( + parse_one(e, dialect=config.model_defaults.dialect), + dialect=config.model_defaults.dialect, + ).sql(dialect=config.model_defaults.dialect) + for e in before_all + ] # To enable parallelism in integration tests config.gateways = {ctx.gateway: config.gateways[ctx.gateway]} @@ -2883,16 +2891,12 @@ def _run_plan(sqlmesh_context: Context, environment: str = None) -> PlanResults: assert plan_1.snapshot_for(model_a).model.view_name in plan_1.schema_metadata.views assert plan_1.snapshot_for(model_b).model.view_name in plan_1.schema_metadata.views - assert len(plan_1.internal_schema_metadata.tables) == 3 + assert len(plan_1.internal_schema_metadata.tables) == 1 assert plan_1.table_name_for(model_a) in plan_1.internal_schema_metadata.tables - assert plan_1.dev_table_name_for(model_a) in plan_1.internal_schema_metadata.tables assert ( plan_1.table_name_for(model_b) not in plan_1.internal_schema_metadata.tables ) # because its a managed table - assert ( - plan_1.dev_table_name_for(model_b) in plan_1.internal_schema_metadata.tables - ) # its dev table is a normal table however assert len(plan_1.internal_schema_metadata.managed_tables) == 1 assert plan_1.table_name_for(model_b) in plan_1.internal_schema_metadata.managed_tables