Skip to content

Commit d493f81

Browse files
committed
add fsspec test
1 parent e788280 commit d493f81

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

tests/catalog/test_sql.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
NoSuchTableError,
3737
TableAlreadyExistsError,
3838
)
39+
from pyiceberg.io import FSSPEC_FILE_IO, PY_IO_IMPL
3940
from pyiceberg.io.pyarrow import schema_to_pyarrow
4041
from pyiceberg.schema import Schema
4142
from pyiceberg.table.snapshots import Operation
@@ -105,6 +106,20 @@ def catalog_sqlite_without_rowcount(warehouse: Path) -> Generator[SqlCatalog, No
105106
catalog.destroy_tables()
106107

107108

109+
@pytest.fixture(scope="module")
110+
def catalog_sqlite_fsspec(warehouse: Path) -> Generator[SqlCatalog, None, None]:
111+
props = {
112+
"uri": "sqlite:////tmp/sql-catalog-fsspec.db",
113+
"warehouse": f"file://{warehouse}-fsspec",
114+
PY_IO_IMPL: FSSPEC_FILE_IO,
115+
}
116+
catalog = SqlCatalog("test_sql_catalog", **props)
117+
catalog.create_tables()
118+
yield catalog
119+
catalog.destroy_tables()
120+
121+
122+
108123
def test_creation_with_no_uri() -> None:
109124
with pytest.raises(NoSuchPropertyException):
110125
SqlCatalog("test_ddb_catalog", not_uri="unused")
@@ -731,6 +746,7 @@ def test_commit_table(catalog: SqlCatalog, table_schema_nested: Schema, random_i
731746
lazy_fixture('catalog_memory'),
732747
lazy_fixture('catalog_sqlite'),
733748
lazy_fixture('catalog_sqlite_without_rowcount'),
749+
lazy_fixture('catalog_sqlite_fsspec'),
734750
],
735751
)
736752
def test_append_table(catalog: SqlCatalog, table_schema_simple: Schema, random_identifier: Identifier) -> None:

0 commit comments

Comments
 (0)