Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI list not working #1122

Open
TiansuYu opened this issue Sep 2, 2024 · 8 comments
Open

CLI list not working #1122

TiansuYu opened this issue Sep 2, 2024 · 8 comments
Labels

Comments

@TiansuYu
Copy link
Contributor

TiansuYu commented Sep 2, 2024

Apache Iceberg version

0.7.1 (latest release)

Please describe the bug 🐞

I am currently trying out the pyiceberg CLI, and found this command seems not working as expected:

pyiceberg list --uri localhost:8181

returns

URI missing, please provide using --uri, the config or environment variable PYICEBERG_CATALOG__DEFAULT__URI

The catalog instance is created from the official quickstart (can confirm it is working by spark-sql and connects to the minio instance and confirm data and metadata files are created correctly). If I understood it correctly, it exposes the catalog at 8181.

I have tried a dozens of others ports and urls (such as s3://warehouse), not working either. Seems the problem is that, the argument is simply not propagated into the config in the end somehow.

@kevinjqliu
Copy link
Contributor

Looks like the catalog inference code requires the URI to include http in front

if uri.startswith("http"):

@TiansuYu
Copy link
Contributor Author

TiansuYu commented Sep 2, 2024

Still the same error:

pyiceberg list --uri http://localhost:8181
URI missing, please provide using --uri, the config or environment variable PYICEBERG_CATALOG__DEFAULT__URI

even if thats the case, the error message is a bit cryptic.

@kevinjqliu
Copy link
Contributor

kevinjqliu commented Sep 2, 2024

can you try

pyiceberg --uri http://localhost:8181 list

from https://py.iceberg.apache.org/cli/

➜ pyiceberg --help
Usage: pyiceberg [OPTIONS] COMMAND [ARGS]...

@kevinjqliu
Copy link
Contributor

even if thats the case, the error message is a bit cryptic.

agreed, the CLI needs some improvements

@TiansuYu
Copy link
Contributor Author

TiansuYu commented Sep 2, 2024

Thanks, putting uri in front of commands worked!
Another thing is

-> % pyiceberg list --help                     
URI missing, please provide using --uri, the config or environment variable PYICEBERG_CATALOG__DEFAULT__URI

I would expect this will not attempting to make any connection calls, but simply print the help message

@kevinjqliu
Copy link
Contributor

I would expect this will not attempting to make any connection calls, but simply print the help message

yea same, perhaps its some setting with the click lib

@run.command()
@click.pass_context
@click.argument("parent", required=False)
@catch_exception()
def list(ctx: Context, parent: Optional[str]) -> None: # pylint: disable=redefined-builtin

@TiansuYu
Copy link
Contributor Author

TiansuYu commented Sep 4, 2024

I would say load_catalog lazily until actually needed, in the main command.

Copy link

github-actions bot commented Mar 4, 2025

This issue has been automatically marked as stale because it has been open for 180 days with no activity. It will be closed in next 14 days if no further activity occurs. To permanently prevent this issue from being considered stale, add the label 'not-stale', but commenting on the issue is preferred when possible.

@github-actions github-actions bot added the stale label Mar 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants