Skip to content

Commit

Permalink
fix CI issue
Browse files Browse the repository at this point in the history
  • Loading branch information
HonahX committed Dec 11, 2023
1 parent 94cfc69 commit 413935e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions pyiceberg/table/refs.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ def __repr__(self) -> str:
"""Return the string representation of the SnapshotRefType class."""
return f"SnapshotRefType.{self.name}"

def __str__(self) -> str:
"""Return the string representation of the SnapshotRefType class."""
return self.value


class SnapshotRef(IcebergBaseModel):
snapshot_id: int = Field(alias="snapshot-id")
Expand Down
4 changes: 2 additions & 2 deletions tests/table/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -757,13 +757,13 @@ def test_assert_ref_snapshot_id(table_v2: Table) -> None:

with pytest.raises(
CommitFailedException,
match="Requirement failed: SnapshotRefType.BRANCH main was created concurrently",
match="Requirement failed: branch main was created concurrently",
):
AssertRefSnapshotId(ref="main", snapshot_id=None).validate(base_metadata)

with pytest.raises(
CommitFailedException,
match="Requirement failed: SnapshotRefType.BRANCH main has changed: expected id 1, found 3055729675574597004",
match="Requirement failed: branch main has changed: expected id 1, found 3055729675574597004",
):
AssertRefSnapshotId(ref="main", snapshot_id=1).validate(base_metadata)

Expand Down

0 comments on commit 413935e

Please sign in to comment.