iceberg-python icon indicating copy to clipboard operation
iceberg-python copied to clipboard

Fix CLI command order and catalog not found error

Open iting0321 opened this issue 9 months ago • 0 comments

Closes #1784

Rationale for this change

The command order for pyiceberg list --catalog hive would raise error; it should be pyiceberg --catalog hive list. Now, pyiceberg list --catalog hive will return the same result as pyiceberg --catalog hive list.

Additionally, for cases where the catalog is not found:
For example, if the default catalog is not set and the command pyiceberg list is executed, it will raise an error stating:
Default catalog not found. Please provide a catalog type using --type.

Are these changes tested?

The tests test_no_catalog_error and test_list_with_catalog_option_wrong_order in tests/cli/test_console.py cover these scenarios.
Additionally, I fixed test_missing_uri. When a catalog exists but the URI is missing, it will now return an appropriate error.

iting0321 avatar Mar 22 '25 09:03 iting0321