You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iceberg.apache.org by bl...@apache.org on 2022/09/29 22:01:17 UTC
[iceberg] branch master updated: Python: Don't throw missing URI error when --uri was provided (#5885)
This is an automated email from the ASF dual-hosted git repository.
blue pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iceberg.git
The following commit(s) were added to refs/heads/master by this push:
new c2bb77332f Python: Don't throw missing URI error when --uri was provided (#5885)
c2bb77332f is described below
commit c2bb77332fb7fb22f26f38027cb6e96fda5be525
Author: Eduard Tudenhöfner <et...@gmail.com>
AuthorDate: Fri Sep 30 00:01:11 2022 +0200
Python: Don't throw missing URI error when --uri was provided (#5885)
---
python/pyiceberg/cli/console.py | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/python/pyiceberg/cli/console.py b/python/pyiceberg/cli/console.py
index e8234d7c7e..bac4ae6bc2 100644
--- a/python/pyiceberg/cli/console.py
+++ b/python/pyiceberg/cli/console.py
@@ -68,9 +68,11 @@ def run(ctx: Context, catalog: str, verbose: bool, output: str, uri: Optional[st
try:
ctx.obj["catalog"] = load_catalog(catalog, **properties)
except ValueError as exc:
- raise ValueError(
- f"URI missing, please provide using --uri, the config or environment variable PYICEBERG_CATALOG__{catalog.upper()}__URI"
- ) from exc
+ if not uri:
+ raise ValueError(
+ f"URI missing, please provide using --uri, the config or environment variable PYICEBERG_CATALOG__{catalog.upper()}__URI"
+ ) from exc
+ raise exc
except Exception as e:
ctx.obj["output"].exception(e)
ctx.exit(1)