|
22 | 22 | from pyiceberg.exceptions import CommitFailedException, ValidationException |
23 | 23 | from pyiceberg.schema import Schema |
24 | 24 | from pyiceberg.table import TableProperties, Transaction |
25 | | -from pyiceberg.table.snapshots import IsolationLevel |
| 25 | +from pyiceberg.table.snapshots import IsolationLevel, Operation |
26 | 26 | from pyiceberg.types import LongType, NestedField, StringType |
27 | 27 |
|
28 | 28 |
|
29 | 29 | def test_isolation_level_enum() -> None: |
30 | | - assert IsolationLevel.SERIALIZABLE == "serializable" |
31 | | - assert IsolationLevel.SNAPSHOT == "snapshot" |
32 | | - assert IsolationLevel("serializable") == IsolationLevel.SERIALIZABLE |
33 | | - assert IsolationLevel("snapshot") == IsolationLevel.SNAPSHOT |
| 30 | + assert IsolationLevel.SERIALIZABLE.value == "serializable" |
| 31 | + assert IsolationLevel.SNAPSHOT.value == "snapshot" |
| 32 | + assert IsolationLevel("serializable") is IsolationLevel.SERIALIZABLE |
| 33 | + assert IsolationLevel("snapshot") is IsolationLevel.SNAPSHOT |
34 | 34 |
|
35 | 35 |
|
36 | 36 | def test_commit_retry_table_properties() -> None: |
@@ -141,7 +141,7 @@ def test_refresh_for_retry_resets_producer_state(catalog: Catalog) -> None: |
141 | 141 |
|
142 | 142 | tx = Transaction(table, autocommit=False) |
143 | 143 | producer = _FastAppendFiles( |
144 | | - operation="append", |
| 144 | + operation=Operation.APPEND, |
145 | 145 | transaction=tx, |
146 | 146 | io=table.io, |
147 | 147 | ) |
@@ -278,7 +278,7 @@ def test_delete_files_refresh_clears_compute_deletes_cache(catalog: Catalog) -> |
278 | 278 |
|
279 | 279 | tx = Transaction(table, autocommit=False) |
280 | 280 | producer = _DeleteFiles( |
281 | | - operation="delete", |
| 281 | + operation=Operation.DELETE, |
282 | 282 | transaction=tx, |
283 | 283 | io=table.io, |
284 | 284 | ) |
|
0 commit comments