Skip to content

[BUG] Catalog.list_tables() inconsistency between docstring and signature #1163

Description

@dataders

Apache Iceberg version

0.7.1 (latest release)

Please describe the bug 馃悶

the docstring for catalog.list_tables() says

If namespace not provided, will list all tables in the catalog.

But I'm finding that to not be the case! The function definition itself seems to not allow this

@abstractmethod
def list_tables(self, namespace: Union[str, Identifier]) -> List[Identifier]:
"""List tables under the given namespace in the catalog.
If namespace not provided, will list all tables in the catalog.
Args:
namespace (str | Identifier): Namespace identifier to search.
Returns:
List[Identifier]: list of table identifiers.
Raises:
NoSuchNamespaceError: If a namespace with the given name does not exist.
"""

error

TypeError: RestCatalog.list_tables() missing 1 required positional argument: 'namespace'
File ~/repos/sandbox-spark-iceberg/.conda/lib/python3.11/site-packages/tenacity/__init__.py:478, in Retrying.__call__(self, fn, *args, **kwargs)
    [476](https://file+.vscode-resource.vscode-cdn.net/Users/dataders/repos/sandbox-spark-iceberg/~/repos/sandbox-spark-iceberg/.conda/lib/python3.11/site-packages/tenacity/__init__.py:476) if isinstance(do, DoAttempt):
    [477](https://file+.vscode-resource.vscode-cdn.net/Users/dataders/repos/sandbox-spark-iceberg/~/repos/sandbox-spark-iceberg/.conda/lib/python3.11/site-packages/tenacity/__init__.py:477)     try:
--> [478](https://file+.vscode-resource.vscode-cdn.net/Users/dataders/repos/sandbox-spark-iceberg/~/repos/sandbox-spark-iceberg/.conda/lib/python3.11/site-packages/tenacity/__init__.py:478)         result = fn(*args, **kwargs)
    [479](https://file+.vscode-resource.vscode-cdn.net/Users/dataders/repos/sandbox-spark-iceberg/~/repos/sandbox-spark-iceberg/.conda/lib/python3.11/site-packages/tenacity/__init__.py:479)     except BaseException:  # noqa: B902
    [480](https://file+.vscode-resource.vscode-cdn.net/Users/dataders/repos/sandbox-spark-iceberg/~/repos/sandbox-spark-iceberg/.conda/lib/python3.11/site-packages/tenacity/__init__.py:480)         retry_state.set_exception(sys.exc_info())  # type: ignore[arg-type]

TypeError: RestCatalog.list_tables() missing 1 required positional argument: 'namespace'

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions