Skip to content

Commit 6b1a3eb

Browse files
Fix Athena Hive and Iceberg schema collision in test_init_project
1 parent 8d0b4de commit 6b1a3eb

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

tests/core/engine_adapter/integration/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import typing as t
77
import time
88
from contextlib import contextmanager
9-
9+
import uuid
1010
import pandas as pd # noqa: TID253
1111
import pytest
1212
from sqlglot import exp, parse_one
@@ -205,7 +205,7 @@ def __init__(
205205
self.mark = mark
206206
self.gateway = gateway
207207
self._columns_to_types = columns_to_types
208-
self.test_id = random_id(short=True)
208+
self.test_id = f"{self.mark}_{uuid.uuid4().hex[:8]}"
209209
self._context: t.Optional[Context] = None
210210
self.is_remote = is_remote
211211
self._schemas: t.List[
@@ -684,7 +684,7 @@ def create_context(
684684
private_sqlmesh_dir / "config.yml",
685685
private_sqlmesh_dir / "config.yaml",
686686
],
687-
variables={"tmp_path": str(path or self.tmp_path)},
687+
variables={"tmp_path": (path or self.tmp_path).as_posix()},
688688
)
689689
if config_mutator:
690690
config_mutator(self.gateway, config)

tests/core/engine_adapter/integration/conftest.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def config(tmp_path: pathlib.Path) -> Config:
3535
pathlib.Path(os.path.join(os.path.dirname(__file__), "config.yaml")),
3636
],
3737
personal_paths=[(SQLMESH_PATH / "config.yaml").expanduser()],
38-
variables={"tmp_path": str(tmp_path)},
38+
variables={"tmp_path": tmp_path.as_posix()},
3939
)
4040

4141

@@ -78,7 +78,9 @@ def _create(engine_name: str, gateway: str) -> EngineAdapter:
7878
if engine_name == "duckdb":
7979
assert isinstance(connection_config, DuckDBConnectionConfig)
8080
for raw_path in [
81-
v for v in (connection_config.catalogs or {}).values() if isinstance(v, str)
81+
v
82+
for v in (connection_config.catalogs or {}).values()
83+
if isinstance(v, str) and v != ":memory:"
8284
]:
8385
pathlib.Path(raw_path).unlink(missing_ok=True)
8486

0 commit comments

Comments
 (0)