mirror of
https://github.com/lancedb/lancedb.git
synced 2026-11-26 12:33:59 +00:00
Merge main and align cosine fix with Lance beta.23
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "lancedb-python"
|
||||
version = "0.42.0-beta.15"
|
||||
version = "0.42.0-beta.17"
|
||||
publish = false
|
||||
edition.workspace = true
|
||||
description = "Python bindings for LanceDB"
|
||||
|
||||
@@ -64,7 +64,7 @@ tests = [
|
||||
"polars>=0.19, <=1.32.3",
|
||||
"pyarrow>=16",
|
||||
"pyarrow-stubs>=16.0",
|
||||
"pylance==15.0.0b22",
|
||||
"pylance==15.0.0b23",
|
||||
"requests>=2.31.0",
|
||||
"datafusion>=54,<55",
|
||||
"opentelemetry-sdk>=1.30.0",
|
||||
|
||||
@@ -1150,7 +1150,14 @@ def _align_field(field: pa.Field, target_field: pa.Field) -> pa.Field:
|
||||
if not any(child.name in ("data", "uri") for child in source_type):
|
||||
raise ValueError(
|
||||
f"blob struct input for column '{field.name}' must contain "
|
||||
"a 'data' or 'uri' child"
|
||||
"a 'data' or 'uri' child. A blob query returns an SDK "
|
||||
"descriptor in this shape, and a descriptor is not payload "
|
||||
"bytes. Use blob_mode='bytes' to materialize payloads, or "
|
||||
"inspect descriptors with blob_mode='descriptions'. To copy "
|
||||
"payloads, select row IDs with with_row_id(True), then call "
|
||||
"table.fetch_blobs(column, row_ids) or "
|
||||
"table.fetch_blob_files(column, row_ids). Keep the source "
|
||||
"unchanged between selection and fetching."
|
||||
)
|
||||
elif not _can_coerce_to_blob(source_type) and not isinstance(
|
||||
source_type, pa.ExtensionType
|
||||
|
||||
@@ -1135,6 +1135,24 @@ def test_copy_blob_subset_preserves_payloads_nulls_and_empty_values(tmp_path):
|
||||
assert sorted(copied, key=lambda row: row["id"]) == rows[:3]
|
||||
|
||||
|
||||
def test_copy_blob_descriptor_rows_explains_payload_materialization(tmp_path):
|
||||
db = lancedb.connect(tmp_path)
|
||||
schema = pa.schema([pa.field("id", pa.int64()), lancedb.blob("image")])
|
||||
source = db.create_table("source", data=[{"id": 1, "image": b"one"}], schema=schema)
|
||||
hits = source.search().where("id = 1").to_arrow()
|
||||
|
||||
with pytest.raises(ValueError, match="must contain a 'data' or 'uri' child") as exc:
|
||||
db.create_table("copy", data=hits, schema=schema)
|
||||
|
||||
message = str(exc.value)
|
||||
assert "blob_mode='bytes'" in message
|
||||
assert "blob_mode='descriptions'" in message
|
||||
assert "with_row_id(True)" in message
|
||||
assert "fetch_blobs(column, row_ids)" in message
|
||||
assert "fetch_blob_files(column, row_ids)" in message
|
||||
assert not db.table_exists(["copy"])
|
||||
|
||||
|
||||
def test_fetch_blobs_round_trip():
|
||||
table = _blob_table(
|
||||
"round_trip",
|
||||
|
||||
Generated
+9
-9
@@ -2147,7 +2147,7 @@ requires-dist = [
|
||||
{ name = "pyarrow-stubs", marker = "extra == 'tests'", specifier = ">=16.0" },
|
||||
{ name = "pydantic", specifier = ">=2.7.4,<3" },
|
||||
{ name = "pylance", marker = "extra == 'pylance'", specifier = ">=15.0.0b3" },
|
||||
{ name = "pylance", marker = "extra == 'tests'", specifier = "==15.0.0b22" },
|
||||
{ name = "pylance", marker = "extra == 'tests'", specifier = "==15.0.0b23" },
|
||||
{ name = "pyright", marker = "extra == 'dev'", specifier = ">=1.1.350" },
|
||||
{ name = "pytest", marker = "extra == 'tests'", specifier = ">=7.0" },
|
||||
{ name = "pytest-asyncio", marker = "extra == 'tests'", specifier = ">=0.21" },
|
||||
@@ -4301,7 +4301,7 @@ crypto = [
|
||||
|
||||
[[package]]
|
||||
name = "pylance"
|
||||
version = "15.0.0b22"
|
||||
version = "15.0.0b23"
|
||||
source = { registry = "https://pypi.fury.io/lance-format/" }
|
||||
dependencies = [
|
||||
{ name = "lance-namespace" },
|
||||
@@ -4312,13 +4312,13 @@ dependencies = [
|
||||
{ name = "pyarrow", version = "26.0.1", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.11'" },
|
||||
]
|
||||
wheels = [
|
||||
{ url = "https://pypi.fury.io/lance-format/-/ver_2gkGO/pylance-15.0.0b22-cp310-abi3-macosx_11_0_arm64.whl", hash = "sha256:401df8ce31ae6263656915c63d3da4411cae59bde2a6d71d12c552e3fa72b6bf" },
|
||||
{ url = "https://pypi.fury.io/lance-format/-/ver_pfuJc/pylance-15.0.0b22-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f5c9ee37b23da4d6fbc341d0e18d355b1602c98fbf096e4589b08ecce57c56ea" },
|
||||
{ url = "https://pypi.fury.io/lance-format/-/ver_YPb1X/pylance-15.0.0b22-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:38e6ed648816ae54ee3e76f21a30c092d47028da1f99242922ec1288d79a1722" },
|
||||
{ url = "https://pypi.fury.io/lance-format/-/ver_1a1jcd/pylance-15.0.0b22-cp310-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:1b7e9f1dfe7ff8e3cbb3b06a3ebd99667629725b6d9a119146f9e1bfac20871f" },
|
||||
{ url = "https://pypi.fury.io/lance-format/-/ver_KRwHG/pylance-15.0.0b22-cp310-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:c31b41b8a8d070f969dcb9dd06aa31190f79d036b27cb5d5ae6d64d5d425502f" },
|
||||
{ url = "https://pypi.fury.io/lance-format/-/ver_2cABdZ/pylance-15.0.0b22-cp310-abi3-win_amd64.whl", hash = "sha256:7b3d36ea7ab7a6a43caecc96ca7f969be11ad89d24ccc6d1788d751fb39e720d" },
|
||||
{ url = "https://pypi.fury.io/lance-format/-/ver_1j6gGW/pylance-15.0.0b22-cp310-abi3-win_arm64.whl", hash = "sha256:20c4e391b4b83008dc2b7877bdd0ad9b3b1251ea05116d79b5637807f4961cc8" },
|
||||
{ url = "https://pypi.fury.io/lance-format/-/ver_ldwuz/pylance-15.0.0b23-cp310-abi3-macosx_11_0_arm64.whl", hash = "sha256:b7980c606424e63e9be645536dbcaff75b479886a53abdae3aef64684c9a6fc4" },
|
||||
{ url = "https://pypi.fury.io/lance-format/-/ver_5wKzE/pylance-15.0.0b23-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a6d887bc81d5f79b8a23d5cbc840cb56dbea4d8b0a9d2c2edf063dea48bcf741" },
|
||||
{ url = "https://pypi.fury.io/lance-format/-/ver_FKuk6/pylance-15.0.0b23-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1424bd48cac2160b7745c9b87cd24d81c7cf2b0a89f342ea46ecd2a473ea74e6" },
|
||||
{ url = "https://pypi.fury.io/lance-format/-/ver_SVglj/pylance-15.0.0b23-cp310-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:09de71b60ac6b8b91fdd73207f71c74bc521626de7e437102ebfe4f2c1f78fa0" },
|
||||
{ url = "https://pypi.fury.io/lance-format/-/ver_SgTr6/pylance-15.0.0b23-cp310-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:d9385471578bec51ae546f7bd7ea638e20bd12d687082d43ed465017dfd992e7" },
|
||||
{ url = "https://pypi.fury.io/lance-format/-/ver_wyipY/pylance-15.0.0b23-cp310-abi3-win_amd64.whl", hash = "sha256:7b98b0d78564c5acea3693334c41dc3ced20484fb2c8e738113eeb078281a109" },
|
||||
{ url = "https://pypi.fury.io/lance-format/-/ver_1v2uEn/pylance-15.0.0b23-cp310-abi3-win_arm64.whl", hash = "sha256:0f4d2645143d44c11237e6ea00772c169a3c6ed23a7c36beaeaef9a18d1be14d" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
||||
Reference in New Issue
Block a user