Skip to content

test: ValkeyDocumentStore removing duplicated tests already covered by haystack Mixin tests + allow non-schema-typed metadata values in Valkey get_metadata_field_unique_value - #3786

Draft
davidsbatista wants to merge 2 commits into
mainfrom
test/consolidate-metadata-unique-values-valkey
Draft

test: ValkeyDocumentStore removing duplicated tests already covered by haystack Mixin tests + allow non-schema-typed metadata values in Valkey get_metadata_field_unique_value#3786
davidsbatista wants to merge 2 commits into
mainfrom
test/consolidate-metadata-unique-values-valkey

Conversation

@davidsbatista

@davidsbatista davidsbatista commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Related Issues

Proposed Changes:

Fixes 4 integration test failures that surfaced after ValkeyDocumentStore started relying on Haystack's shared DocumentStore test mixin (ground truth for all doc stores), which expects behavior Valkey's
schema-based metadata didn't support:

  • Unknown field no longer raises — get_metadata_field_unique_values()/_async used to raise ValueError when queried on a field not pre-configured for filtering. Since the values are already computed from
    the document's raw JSON payload (not the search index), this check was unnecessary — removed it. Querying an unknown field now correctly returns ([], 0).
  • Type-mismatched writes no longer fail — writing a value that didn't match its field's configured index type (e.g. a string into a numeric field) used to raise ValueError and abort the whole write. Now
    the value is just omitted from the search index for that field/document, while the original value is still kept in the payload — so writes succeed and reads stay correct.
  • Fixed a value-collapsing bug — unique values were deduplicated by their string form only, so 1, "1", 1.0, and True were incorrectly treated as the same value. Dedup now also checks the value's type,
    so these are kept distinct.

How did you test it?

  • full local suite (make all: lint, mypy, unit, integration against a real Valkey container + CI

Notes for the reviewer

  • No changes to the shared Haystack DocumentStore test mixin — only to ValkeyDocumentStore and Valkey-local tests.

Checklist

@davidsbatista davidsbatista changed the title tests: ValkeyDocumentStore removing duplicated tests already covered by haystack Mixin tests + test: ValkeyDocumentStore removing duplicated tests already covered by haystack Mixin tests + allow non-schema-typed metadata values in Valkey get_metadata_field_unique_value Aug 14, 2026
@github-actions github-actions Bot added the type:documentation Improvements or additions to documentation label Aug 14, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Coverage report (valkey)

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  integrations/valkey/src/haystack_integrations/document_stores/valkey
  document_store.py 1046, 1075-1077, 1326, 1491-1508
Project Total  

This report was generated by python-coverage-comment-action

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration:valkey type:documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant