diff --git a/python/tests/unit/data/conftest.py b/python/tests/unit/data/conftest.py index d29bad7f8b0d..0d5064989778 100644 --- a/python/tests/unit/data/conftest.py +++ b/python/tests/unit/data/conftest.py @@ -221,6 +221,17 @@ def data_model_pandas_definition() -> object: ) +@fixture +async def pandas_vector_store_record_collection(DictVectorStoreRecordCollection, data_model_pandas_definition): + from pandas import DataFrame + + return DictVectorStoreRecordCollection( + collection_name="test", + record_type=DataFrame, + definition=data_model_pandas_definition, + ) + + @fixture def record_type_vanilla(): @vectorstoremodel diff --git a/python/tests/unit/data/test_vector_store_record_collection.py b/python/tests/unit/data/test_vector_store_record_collection.py index ece736b9338b..cb133ddc05e4 100644 --- a/python/tests/unit/data/test_vector_store_record_collection.py +++ b/python/tests/unit/data/test_vector_store_record_collection.py @@ -172,46 +172,36 @@ async def test_crud_batch_operations_container(vector_store_record_collection): assert len(vector_store_record_collection.inner_storage) == 0 -@mark.parametrize( - "vector_store_record_collection", - ["definition_pandas"], - indirect=True, -) -async def test_crud_operations_pandas(vector_store_record_collection): +async def test_crud_operations_pandas(pandas_vector_store_record_collection): id = "test_id" record = DataFrame([{"id": id, "content": "test_content", "vector": [1.0, 2.0, 3.0]}]) - no_records = await vector_store_record_collection.get(id) + no_records = await pandas_vector_store_record_collection.get(id) assert no_records is None - await vector_store_record_collection.upsert(record) - assert len(vector_store_record_collection.inner_storage) == 1 + await pandas_vector_store_record_collection.upsert(record) + assert len(pandas_vector_store_record_collection.inner_storage) == 1 - assert vector_store_record_collection.inner_storage[id]["content"] == record["content"].values[0] - assert vector_store_record_collection.inner_storage[id]["vector"] == record["vector"].values[0] - record_2 = await vector_store_record_collection.get(id) + assert pandas_vector_store_record_collection.inner_storage[id]["content"] == record["content"].values[0] + assert pandas_vector_store_record_collection.inner_storage[id]["vector"] == record["vector"].values[0] + record_2 = await pandas_vector_store_record_collection.get(id) assert record_2.equals(record) - await vector_store_record_collection.delete(id) - assert len(vector_store_record_collection.inner_storage) == 0 + await pandas_vector_store_record_collection.delete(id) + assert len(pandas_vector_store_record_collection.inner_storage) == 0 -@mark.parametrize( - "vector_store_record_collection", - ["definition_pandas"], - indirect=True, -) -async def test_crud_batch_operations_pandas(vector_store_record_collection): +async def test_crud_batch_operations_pandas(pandas_vector_store_record_collection): ids = ["test_id_1", "test_id_2"] batch = DataFrame([{"id": id, "content": "test_content", "vector": [1.0, 2.0, 3.0]} for id in ids]) - no_records = await vector_store_record_collection.get(ids) + no_records = await pandas_vector_store_record_collection.get(ids) assert no_records is None - await vector_store_record_collection.upsert(batch) - assert len(vector_store_record_collection.inner_storage) == 2 - assert vector_store_record_collection.inner_storage[ids[0]]["content"] == batch["content"].values[0] - assert vector_store_record_collection.inner_storage[ids[0]]["vector"] == batch["vector"].values[0] - records = await vector_store_record_collection.get(ids) + await pandas_vector_store_record_collection.upsert(batch) + assert len(pandas_vector_store_record_collection.inner_storage) == 2 + assert pandas_vector_store_record_collection.inner_storage[ids[0]]["content"] == batch["content"].values[0] + assert pandas_vector_store_record_collection.inner_storage[ids[0]]["vector"] == batch["vector"].values[0] + records = await pandas_vector_store_record_collection.get(ids) assert records.equals(batch) - await vector_store_record_collection.delete(ids) - assert len(vector_store_record_collection.inner_storage) == 0 + await pandas_vector_store_record_collection.delete(ids) + assert len(pandas_vector_store_record_collection.inner_storage) == 0 # region Fails diff --git a/python/uv.lock b/python/uv.lock index 44c249e89981..cc17f341a339 100644 --- a/python/uv.lock +++ b/python/uv.lock @@ -1,4 +1,5 @@ version = 1 +revision = 3 requires-python = ">=3.10" resolution-markers = [ "python_full_version >= '4' and sys_platform == 'darwin'", @@ -638,14 +639,14 @@ wheels = [ [[package]] name = "bleach" -version = "6.3.0" +version = "6.4.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "webencodings", marker = "sys_platform == 'darwin' or sys_platform == 'linux' or sys_platform == 'win32'" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/07/18/3c8523962314be6bf4c8989c79ad9531c825210dd13a8669f6b84336e8bd/bleach-6.3.0.tar.gz", hash = "sha256:6f3b91b1c0a02bb9a78b5a454c92506aa0fdf197e1d5e114d2e00c6f64306d22", size = 203533, upload-time = "2025-10-27T17:57:39.211Z" } +sdist = { url = "https://files.pythonhosted.org/packages/48/3c/e12ac860709702bd5ebeb9b56a4fe334f1001246ee1b8f2b7ee28912df7d/bleach-6.4.0.tar.gz", hash = "sha256:4202482733d85cedd04e59fcb2f89f4e4c7c385a78d3c3c23c30446843a37452", size = 204857, upload-time = "2026-06-05T13:01:13.734Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/cd/3a/577b549de0cc09d95f11087ee63c739bba856cd3952697eec4c4bb91350a/bleach-6.3.0-py3-none-any.whl", hash = "sha256:fe10ec77c93ddf3d13a73b035abaac7a9f5e436513864ccdad516693213c65d6", size = 164437, upload-time = "2025-10-27T17:57:37.538Z" }, + { url = "https://files.pythonhosted.org/packages/58/9d/40b6267367182187139a4000b82a3b287d84d745bccd808e75d916920e9d/bleach-6.4.0-py3-none-any.whl", hash = "sha256:4b6b6a54fff2e69a3dde9d21cc6301220bee3c3cb792187d11403fd795031081", size = 165109, upload-time = "2026-06-05T13:01:12.504Z" }, ] [package.optional-dependencies] @@ -6480,13 +6481,13 @@ requires-dist = [ { name = "azure-cosmos", marker = "extra == 'azure'", specifier = "~=4.7" }, { name = "azure-identity", specifier = ">=1.13" }, { name = "azure-search-documents", marker = "extra == 'azure'", specifier = ">=11.6.0b4,<12.0.0" }, - { name = "boto3", marker = "extra == 'aws'", specifier = ">=1.36.4,<1.41.0" }, + { name = "boto3", marker = "extra == 'aws'", specifier = ">=1.36.4,<1.43.0" }, { name = "chromadb", marker = "extra == 'chroma'", specifier = ">=0.5,<1.4" }, { name = "cloudevents", specifier = "~=1.0" }, { name = "defusedxml", specifier = "~=0.7" }, { name = "faiss-cpu", marker = "extra == 'faiss'", specifier = ">=1.10.0" }, { name = "google-cloud-aiplatform", marker = "extra == 'google'", specifier = ">=1.114,<1.134" }, - { name = "google-genai", marker = "extra == 'google'", specifier = "~=1.51.0" }, + { name = "google-genai", marker = "extra == 'google'", specifier = ">=1.51,<1.75" }, { name = "ipykernel", marker = "extra == 'notebooks'", specifier = ">=6.29,<8.0" }, { name = "jinja2", specifier = "~=3.1" }, { name = "mcp", specifier = ">=1.26.0" }, @@ -6494,7 +6495,7 @@ requires-dist = [ { name = "microsoft-agents-activity", marker = "extra == 'copilotstudio'", specifier = ">=0.3.1" }, { name = "microsoft-agents-copilotstudio-client", marker = "extra == 'copilotstudio'", specifier = ">=0.3.1" }, { name = "milvus", marker = "sys_platform != 'win32' and extra == 'milvus'", specifier = ">=2.3,<2.3.8" }, - { name = "mistralai", marker = "extra == 'mistralai'", specifier = ">=1.2,<2.0" }, + { name = "mistralai", marker = "extra == 'mistralai'", specifier = ">=1.2,<2.4.6" }, { name = "motor", marker = "extra == 'mongo'", specifier = ">=3.3.2,<3.8.0" }, { name = "nest-asyncio", specifier = "~=1.6" }, { name = "numpy", marker = "python_full_version < '3.12'", specifier = ">=1.25.0" }, @@ -6514,7 +6515,7 @@ requires-dist = [ { name = "psycopg", extras = ["binary", "pool"], marker = "extra == 'postgres'", specifier = "~=3.2" }, { name = "pyarrow", marker = "extra == 'usearch'", specifier = ">=12.0,<22.0" }, { name = "pybars4", specifier = "~=0.9" }, - { name = "pydantic", specifier = ">=2.0,!=2.10.0,!=2.10.1,!=2.10.2,!=2.10.3,<2.13" }, + { name = "pydantic", specifier = ">=2.0,!=2.10.0,!=2.10.1,!=2.10.2,!=2.10.3,<2.14" }, { name = "pydantic-settings", specifier = "~=2.0" }, { name = "pymilvus", marker = "extra == 'milvus'", specifier = ">=2.3,<2.7" }, { name = "pymongo", marker = "extra == 'mongo'", specifier = ">=4.8.0,<4.16" },