refactor!: use namespace models directly for namespace operations (#2806)

1. Use generated models in lance-namespace for request response models
to avoid multiple layers of conversions
2. Make sure the API is consistent with the namespace spec
3. Deprecate the table_names API in favor of the list_tables API in
namespace that allows full pagination support without the need to have
sorted table names
4. Add describe_namespace API which was a miss in the original
implementation
This commit is contained in:
Jack Ye
2025-12-02 22:41:04 -08:00
committed by GitHub
parent 9d638cb3c7
commit d1efc6ad8a
15 changed files with 1250 additions and 274 deletions

View File

@@ -892,7 +892,7 @@ def test_local_namespace_operations(tmp_path):
db = lancedb.connect(tmp_path)
# Test list_namespaces returns empty list for root namespace
namespaces = list(db.list_namespaces())
namespaces = db.list_namespaces().namespaces
assert namespaces == []
# Test list_namespaces with non-empty namespace raises NotImplementedError
@@ -900,7 +900,7 @@ def test_local_namespace_operations(tmp_path):
NotImplementedError,
match="Namespace operations are not supported for listing database",
):
list(db.list_namespaces(namespace=["test"]))
db.list_namespaces(namespace=["test"])
def test_local_create_namespace_not_supported(tmp_path):