Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion integrations/valkey/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ classifiers = [
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
]
dependencies = ["haystack-ai>=2.24.0", "valkey-glide>=2.1.0", "valkey-glide-sync>=2.1.0"]
dependencies = ["haystack-ai>=2.26.1", "valkey-glide>=2.1.0", "valkey-glide-sync>=2.1.0"]

[project.urls]
Documentation = "https://github.com/deepset-ai/haystack-core-integrations/tree/main/integrations/valkey#readme"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1544,7 +1544,7 @@ def _validate_and_normalize_metadata_fields(metadata_fields: dict[str, type[str]
msg = "metadata_fields must be a dictionary"
raise ValueError(msg)

type_mapping = {str: "tag", int: "numeric"}
type_mapping = {str: "tag", int: "numeric", float: "numeric"}

normalized = {}
for field_name, field_type in metadata_fields.items():
Expand Down
16 changes: 16 additions & 0 deletions integrations/valkey/tests/test_document_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,16 @@
from haystack.dataclasses.byte_stream import ByteStream
from haystack.document_stores.types import DuplicatePolicy
from haystack.testing.document_store import (
CountDocumentsByFilterTest,
CountDocumentsTest,
CountUniqueMetadataByFilterTest,
DeleteAllTest,
DeleteByFilterTest,
DeleteDocumentsTest,
FilterableDocsFixtureMixin,
GetMetadataFieldMinMaxTest,
GetMetadataFieldsInfoTest,
GetMetadataFieldUniqueValuesTest,
UpdateByFilterTest,
WriteDocumentsTest,
create_filterable_docs,
Expand Down Expand Up @@ -49,6 +54,11 @@ class TestValkeyDocumentStore(
DeleteDocumentsTest,
FilterableDocsFixtureMixin,
UpdateByFilterTest,
CountDocumentsByFilterTest,
CountUniqueMetadataByFilterTest,
GetMetadataFieldsInfoTest,
GetMetadataFieldMinMaxTest,
GetMetadataFieldUniqueValuesTest,
):
@pytest.fixture
def document_store(self):
Expand All @@ -64,6 +74,8 @@ def document_store(self):
"quality": str,
"year": int,
"featured": int, # for base-class test_update_by_filter_advanced_filters (meta.featured)
"rating": float, # for GetMetadataFieldMinMaxTest (float field)
"age": int, # for GetMetadataFieldMinMaxTest meta_prefix test
# for base-class UpdateByFilterTest.filterable_docs and filter tests:
"name": str,
"page": str,
Expand Down Expand Up @@ -94,6 +106,10 @@ def test_write_documents(self, document_store):
assert document_store.write_documents(docs) == 1
assert document_store.count_documents() == 1

def test_get_metadata_fields_info_empty_collection(self, document_store):
"""Valkey pre-configures metadata fields at init, so they're always present even when empty."""
pytest.skip("Valkey metadata fields are pre-configured at init, not discovered from documents")

def test_write_documents_duplicate_fail(self, document_store):
"""Valkey only supports OVERWRITE policy, skip FAIL test."""
pytest.skip("Valkey only supports DuplicatePolicy.OVERWRITE")
Expand Down
Loading