mirror of
https://github.com/lancedb/lancedb.git
synced 2026-11-13 14:16:54 +00:00
chore: update lance dependency to v15.0.0-beta.8 (#4792)
Update the Rust workspace and Java SDK dependencies to [Lance v15.0.0-beta.8](https://github.com/lance-format/lance/releases/tag/v15.0.0-beta.8), preserve the optional `manifest_size` field in remote version responses, and verify directory-namespace renames preserve registration and data both within and across namespaces. Update the Rust and TypeScript API documentation to reflect directory-namespace rename support. Rust callers constructing `Version` literals must now provide `manifest_size` (`None` when unavailable). Java is intentionally pinned to beta.8 even while Maven artifacts are still publishing; dependency-resolution CI failures caused solely by that publishing delay are accepted for this upgrade. Python package pins remain unchanged. --------- Co-authored-by: Jack Ye <yezhaoqin@gmail.com>
This commit is contained in:
@@ -582,37 +582,43 @@ class TestNamespaceConnection:
|
||||
assert table_schema.field("id").type == pa.int64()
|
||||
assert table_schema.field("text").type == pa.string()
|
||||
|
||||
def test_rename_table(self):
|
||||
"""Test that rename_table renames a table in the namespace.
|
||||
|
||||
The `dir` namespace implementation in lance-namespace-impls does not
|
||||
implement `rename_table` yet (only the `rest` backend does), so it
|
||||
currently falls back to the default trait method which raises
|
||||
NotSupported. This is expected to start passing once the `dir`
|
||||
backend gains rename_table support upstream.
|
||||
"""
|
||||
@pytest.mark.parametrize("destination_namespace", ["test_ns", "destination_ns"])
|
||||
def test_rename_table(self, destination_namespace):
|
||||
"""Test that renaming a table preserves its data and namespace registration."""
|
||||
db = lancedb.connect_namespace("dir", {"root": self.temp_dir})
|
||||
|
||||
# Create a child namespace first
|
||||
db.create_namespace(["test_ns"])
|
||||
if destination_namespace != "test_ns":
|
||||
db.create_namespace([destination_namespace])
|
||||
|
||||
# Create a table in child namespace
|
||||
schema = pa.schema(
|
||||
[
|
||||
pa.field("id", pa.int64()),
|
||||
pa.field("vector", pa.list_(pa.float32(), 2)),
|
||||
]
|
||||
)
|
||||
db.create_table("old_name", schema=schema, namespace_path=["test_ns"])
|
||||
data = pa.Table.from_pylist(
|
||||
[{"id": 1, "vector": [1.0, 2.0]}, {"id": 2, "vector": [3.0, 4.0]}],
|
||||
schema=schema,
|
||||
)
|
||||
db.create_table("old_name", data=data, namespace_path=["test_ns"])
|
||||
|
||||
# Rename the table within the same namespace
|
||||
with pytest.raises(NotImplementedError, match="rename_table not implemented"):
|
||||
db.rename_table(
|
||||
"old_name",
|
||||
"new_name",
|
||||
cur_namespace_path=["test_ns"],
|
||||
new_namespace_path=["test_ns"],
|
||||
)
|
||||
db.rename_table(
|
||||
"old_name",
|
||||
"new_name",
|
||||
cur_namespace_path=["test_ns"],
|
||||
new_namespace_path=[destination_namespace],
|
||||
)
|
||||
|
||||
reopened = lancedb.connect_namespace("dir", {"root": self.temp_dir})
|
||||
assert "old_name" not in reopened.table_names(namespace_path=["test_ns"])
|
||||
assert "new_name" in reopened.table_names(
|
||||
namespace_path=[destination_namespace]
|
||||
)
|
||||
with pytest.raises(TableNotFoundError):
|
||||
reopened.open_table("old_name", namespace_path=["test_ns"])
|
||||
table = reopened.open_table("new_name", namespace_path=[destination_namespace])
|
||||
assert table.namespace == [destination_namespace]
|
||||
assert table.to_arrow().equals(data)
|
||||
|
||||
def test_drop_all_tables(self):
|
||||
"""Test dropping all tables through namespace."""
|
||||
|
||||
Reference in New Issue
Block a user