jason810496 commented on code in PR #1828: URL: https://github.com/apache/iceberg-python/pull/1828#discussion_r2008723316
########## pyiceberg/cli/console.py: ########## @@ -86,31 +91,48 @@ def run( ctx.obj["output"] = JsonOutput(verbose=verbose) try: - ctx.obj["catalog"] = load_catalog(catalog, **properties) + ctx.obj["first_level_catalog"] = catalog + ctx.obj["second_level_catalog"] = None + ctx.obj["properties"] = properties + except Exception as e: ctx.obj["output"].exception(e) ctx.exit(1) + +def _load_the_catalog_with_first_level_catalog(ctx: Context) -> None: + if ctx.obj["first_level_catalog"] is None and ctx.obj["second_level_catalog"] is None: + ctx.obj["catalog"] = load_catalog(None, **ctx.obj["properties"]) + elif ctx.obj["first_level_catalog"] is not None and ctx.obj["second_level_catalog"] is None: + ctx.obj["catalog"] = load_catalog(ctx.obj["first_level_catalog"],**ctx.obj["properties"]) + else: + ctx.obj["catalog"] = load_catalog(ctx.obj["second_level_catalog"],**ctx.obj["properties"]) + print("cataloglll",ctx.obj["catalog"]) + + if not isinstance(ctx.obj["catalog"], Catalog): ctx.obj["output"].exception( - ValueError("Could not determine catalog type from uri. REST (http/https) and Hive (thrift) is supported") + ValueError("Could not determine catalog type from uri. REST (http/https) and Hive (thrift) is supported") Review Comment: Nit: The indentation, as well as the order of imported modules, can be fixed based on the last comment. ```suggestion ValueError("Could not determine catalog type from uri. REST (http/https) and Hive (thrift) is supported") ``` -- 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