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}") + + +@run.command() +@click.argument("identifier") +@click.option("--type", required=False) +@click.option("--verbose", type=click.BOOL) +@click.pass_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: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org