Fokko commented on code in PR #137:
URL: https://github.com/apache/iceberg-python/pull/137#discussion_r1389203952
##########
pyiceberg/cli/console.py:
##########
@@ -372,3 +377,50 @@ def table(ctx: Context, identifier: str, property_name:
str) -> None: # noqa: F
ctx.exit(1)
else:
raise NoSuchPropertyException(f"Property {property_name} does not
exist on {identifier}")
+
+
[email protected]()
[email protected]("identifier")
[email protected]("--type", required=False)
[email protected]("--verbose", type=click.BOOL)
[email protected]_context
+@catch_exception()
+def list_refs(ctx: Context, identifier: str, type: str, verbose: bool) -> None:
+ """List all the refs in the provided table."""
+ catalog, output = _catalog_and_output(ctx)
+ table = catalog.load_table(identifier)
+ refs = table.refs()
+ if type:
+ type = type.lower()
+ if type not in {"branch", "tag"}:
+ raise ValueError("Type must be either branch or tag")
Review Comment:
```suggestion
raise ValueError(f"Type must be either branch or tag, got:
{type}")
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]