Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft: Python: Add __repr__ for Catalog #8558

Merged
merged 10 commits into from
Sep 22, 2023
4 changes: 4 additions & 0 deletions python/pyiceberg/catalog/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -600,3 +600,7 @@ def _get_updated_props_and_update_summary(
)

return properties_update_summary, updated_properties

def __repr__(self) -> str:
"""Return the string representation of the Catalog class."""
return f"{self.name} ({self.__class__})"
5 changes: 5 additions & 0 deletions python/tests/catalog/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -598,3 +598,8 @@ def test_add_column_with_statement(catalog: InMemoryCatalog) -> None:
schema_id=0,
identifier_field_ids=[],
)


def test_catalog_repr(catalog: InMemoryCatalog) -> None:
s = repr(catalog)
assert s == "test.in.memory.catalog (<class 'test_base.InMemoryCatalog'>)"
Fokko marked this conversation as resolved.
Show resolved Hide resolved
Loading