Fokko commented on code in PR #5957:
URL: https://github.com/apache/iceberg/pull/5957#discussion_r993032719
##########
python/pyiceberg/cli/console.py:
##########
@@ -65,14 +65,7 @@ def run(ctx: Context, catalog: str, verbose: bool, output:
str, uri: Optional[st
ctx.obj["output"] = JsonOutput(verbose=verbose)
try:
- try:
- ctx.obj["catalog"] = load_catalog(catalog, **properties)
- except ValueError as exc:
- if not uri:
Review Comment:
Mostly because it is at a very high level, and the `ValueError` is very
broad. For example, if you would provide a credential without a semicolon, it
would throw a ValueError:
```
>>> client, secret = "abc".split(":")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: not enough values to unpack (expected 2, got 1)
```
Next to that we only check if the `uri` is passed in from the CLI
`--credential abc:def` (and ignore if it is passed in from the config). This
results in the error that the URI is not set (while your credential does not
have a `:`). Therefore I prefer pushing this exception down.
--
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]