@@ -61,7 +61,7 @@ def catalog_memory(catalog_name: str, warehouse: Path) -> Generator[SqlCatalog,
6161@pytest .fixture (scope = "module" )
6262def catalog_sqlite (catalog_name : str , warehouse : Path ) -> Generator [SqlCatalog , None , None ]:
6363 props = {
64- "uri" : f"sqlite://// { warehouse } /sql-catalog" ,
64+ "uri" : f"sqlite:///{ warehouse . as_posix () } /sql-catalog" ,
6565 "warehouse" : f"file://{ warehouse } " ,
6666 }
6767 catalog = SqlCatalog (catalog_name , ** props )
@@ -72,7 +72,7 @@ def catalog_sqlite(catalog_name: str, warehouse: Path) -> Generator[SqlCatalog,
7272
7373@pytest .fixture (scope = "module" )
7474def catalog_uri (warehouse : Path ) -> str :
75- return f"sqlite://// { warehouse } /sql-catalog"
75+ return f"sqlite:///{ warehouse . as_posix () } /sql-catalog"
7676
7777
7878@pytest .fixture (scope = "module" )
@@ -96,7 +96,7 @@ def test_creation_with_echo_parameter(catalog_name: str, warehouse: Path) -> Non
9696
9797 for echo_param , expected_echo_value in test_cases :
9898 props = {
99- "uri" : f"sqlite://// { warehouse } /sql-catalog" ,
99+ "uri" : f"sqlite:///{ warehouse . as_posix () } /sql-catalog" ,
100100 "warehouse" : f"file://{ warehouse } " ,
101101 }
102102 # None is for default value
@@ -119,7 +119,7 @@ def test_creation_with_pool_pre_ping_parameter(catalog_name: str, warehouse: Pat
119119
120120 for pool_pre_ping_param , expected_pool_pre_ping_value in test_cases :
121121 props = {
122- "uri" : f"sqlite://// { warehouse } /sql-catalog" ,
122+ "uri" : f"sqlite:///{ warehouse . as_posix () } /sql-catalog" ,
123123 "warehouse" : f"file://{ warehouse } " ,
124124 }
125125 # None is for default value
@@ -139,7 +139,7 @@ def test_creation_from_impl(catalog_name: str, warehouse: Path) -> None:
139139 catalog_name ,
140140 ** {
141141 "py-catalog-impl" : "pyiceberg.catalog.sql.SqlCatalog" ,
142- "uri" : f"sqlite://// { warehouse } /sql-catalog" ,
142+ "uri" : f"sqlite:///{ warehouse . as_posix () } /sql-catalog" ,
143143 "warehouse" : f"file://{ warehouse } " ,
144144 },
145145 ),
@@ -268,7 +268,7 @@ def get_columns(engine: Engine) -> set[str]:
268268
269269
270270def test_adds_iceberg_type_column_to_old_schema (warehouse : Path ) -> None :
271- uri = f"sqlite://// { warehouse } /test-migration-add-col"
271+ uri = f"sqlite:///{ warehouse . as_posix () } /test-migration-add-col"
272272 engine = _create_v0_db (uri )
273273
274274 # Verify the column does not exist in the old schema
@@ -334,7 +334,7 @@ def test_list_tables_filters_by_iceberg_type(warehouse: Path) -> None:
334334
335335
336336def test_migration_to_v1_with_property_set (warehouse : Path ) -> None :
337- uri = f"sqlite://// { warehouse } /test-v1-migrate"
337+ uri = f"sqlite:///{ warehouse . as_posix () } /test-v1-migrate"
338338 engine = _create_v0_db (uri )
339339
340340 assert "iceberg_type" not in get_columns (engine )
@@ -361,7 +361,7 @@ def test_invalid_schema_version_raises(warehouse: Path) -> None:
361361
362362def test_list_tables_works_on_v0_schema (warehouse : Path ) -> None :
363363 """list_tables should work on V0 schemas without iceberg_type column."""
364- uri = f"sqlite://// { warehouse } /test-v0-list"
364+ uri = f"sqlite:///{ warehouse . as_posix () } /test-v0-list"
365365 _create_v0_db (uri )
366366
367367 catalog = SqlCatalog (
@@ -441,15 +441,15 @@ def _make_v0_catalog(uri: str, warehouse: Path) -> SqlCatalog:
441441
442442def test_namespace_exists_on_v0_schema (warehouse : Path ) -> None :
443443 """namespace_exists should not fail on V0 schema (no iceberg_type column)."""
444- catalog = _make_v0_catalog (f"sqlite://// { warehouse } /test-v0-ns-exists" , warehouse )
444+ catalog = _make_v0_catalog (f"sqlite:///{ warehouse . as_posix () } /test-v0-ns-exists" , warehouse )
445445 catalog .create_namespace ("ns" )
446446 assert catalog .namespace_exists ("ns" )
447447 assert not catalog .namespace_exists ("missing" )
448448
449449
450450def test_create_and_load_table_on_v0_schema (warehouse : Path ) -> None :
451451 """create_table and load_table should work on V0 schema without iceberg_type column."""
452- catalog = _make_v0_catalog (f"sqlite://// { warehouse } /test-v0-create" , warehouse )
452+ catalog = _make_v0_catalog (f"sqlite:///{ warehouse . as_posix () } /test-v0-create" , warehouse )
453453 catalog .create_namespace ("ns" )
454454 schema = Schema (NestedField (1 , "id" , StringType (), required = True ))
455455 tbl = catalog .create_table (("ns" , "tbl" ), schema )
0 commit comments