Skip to content

Commit 4b3a113

Browse files
committed
fix unit tests
1 parent b10575c commit 4b3a113

3 files changed

Lines changed: 12 additions & 3 deletions

File tree

pyiceberg/table/update/snapshot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ def _validate_target_branch(self, branch: str | None) -> str | None:
146146

147147
def append_data_file(self, data_file: DataFile) -> _SnapshotProducer[U]:
148148
if data_file.content == DataFileContent.EQUALITY_DELETES:
149-
raise NotImplementedError(f"PyIceberg does not support writing {data_file.content}")
149+
raise NotImplementedError(f"PyIceberg does not support writing {data_file.content.name}")
150150
self._added_data_files.append(data_file)
151151
return self
152152

tests/io/test_equality_deletes.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,7 @@ def test_block_writing_equality_deletes(table_schema: Schema, catalog: Catalog)
282282
identifier = "default.test_block_writing_equality_deletes"
283283

284284
# Create table with MoR delete mode
285+
catalog.create_namespace("default")
285286
catalog.create_table(
286287
identifier,
287288
schema=table_schema,
@@ -290,7 +291,15 @@ def test_block_writing_equality_deletes(table_schema: Schema, catalog: Catalog)
290291

291292
tbl = catalog.load_table(identifier)
292293

293-
df = pa.Table.from_pydict({"id": [1], "data": ["a"]})
294+
df = pa.Table.from_pydict(
295+
{"id": [1], "data": ["a"]},
296+
schema=pa.schema(
297+
[
298+
pa.field("id", pa.int32()),
299+
pa.field("data", pa.string()),
300+
]
301+
),
302+
)
294303
tbl.append(df)
295304

296305
# Create a Equality Delete file to force writing it.

tests/table/test_snapshots.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@ def test_block_writing_equality_deletes(table_schema_simple: Schema, catalog: Ca
584584
with tx.update_snapshot().fast_append() as append:
585585
append.append_data_file(delete_file)
586586

587-
assert "PyIceberg does not support writing DataFileContent.EQUALITY_DELETES" in str(exc.value)
587+
assert "PyIceberg does not support writing EQUALITY_DELETES" in str(exc.value)
588588

589589

590590
def test_delete_mode_mor_warns(table_schema_simple: Schema, catalog: Catalog) -> None:

0 commit comments

Comments
 (0)