|
36 | 36 | NoSuchTableError, |
37 | 37 | TableAlreadyExistsError, |
38 | 38 | ) |
| 39 | +from pyiceberg.io import FSSPEC_FILE_IO, PY_IO_IMPL |
39 | 40 | from pyiceberg.io.pyarrow import schema_to_pyarrow |
40 | 41 | from pyiceberg.schema import Schema |
41 | 42 | from pyiceberg.table.snapshots import Operation |
@@ -105,6 +106,20 @@ def catalog_sqlite_without_rowcount(warehouse: Path) -> Generator[SqlCatalog, No |
105 | 106 | catalog.destroy_tables() |
106 | 107 |
|
107 | 108 |
|
| 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 | + |
108 | 123 | def test_creation_with_no_uri() -> None: |
109 | 124 | with pytest.raises(NoSuchPropertyException): |
110 | 125 | SqlCatalog("test_ddb_catalog", not_uri="unused") |
@@ -731,6 +746,7 @@ def test_commit_table(catalog: SqlCatalog, table_schema_nested: Schema, random_i |
731 | 746 | lazy_fixture('catalog_memory'), |
732 | 747 | lazy_fixture('catalog_sqlite'), |
733 | 748 | lazy_fixture('catalog_sqlite_without_rowcount'), |
| 749 | + lazy_fixture('catalog_sqlite_fsspec'), |
734 | 750 | ], |
735 | 751 | ) |
736 | 752 | def test_append_table(catalog: SqlCatalog, table_schema_simple: Schema, random_identifier: Identifier) -> None: |
|
0 commit comments