Skip to content

fix: allow FilterRetriever to clear default filters - #12629

Merged
sjrl merged 1 commit into
deepset-ai:mainfrom
CoralGarden52:fix/filter-retriever-empty-filter-override
Sep 7, 2026
Merged

sjrl merged 1 commit into
deepset-ai:mainfrom
CoralGarden52:fix/filter-retriever-empty-filter-override

Conversation

@CoralGarden52

Copy link
Copy Markdown
Contributor

Related Issues

None.

Proposed Changes

FilterRetriever previously used a truthiness fallback, so an explicit empty runtime filter dictionary reused filters supplied at initialization. The runtime value now overrides constructor filters whenever it is provided, including an empty dictionary.

Added synchronous and asynchronous regression tests for direct calls plus Pipeline.run and Pipeline.run_async.

How did you test it?

  • Targeted FilterRetriever tests: 18 passed.
  • Full test/components/retrievers suite: 216 passed, 11 skipped (pre-existing integration skips).
  • Formatting and lint: hatch run fmt.
  • Type checking: hatch run test:types.

Notes for the reviewer

The implementation matches MultiRetriever, which already distinguishes an omitted filter from an explicit empty filter.

This PR was fully generated with an AI assistant. I have reviewed the changes and run the relevant tests.

Checklist

  • I have read the contributors guidelines and code of conduct.
  • I have added regression tests.
  • The title uses the conventional fix: prefix.
  • I have added a release note file.
  • I have run the relevant quality checks.

@CoralGarden52
CoralGarden52 requested a review from a team as a code owner September 6, 2026 07:36
@CoralGarden52
CoralGarden52 requested review from sjrl and removed request for a team September 6, 2026 07:36
@vercel

vercel Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

@CoralGarden52 is attempting to deploy a commit to the deepset Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Hi @CoralGarden52, thanks for your interest in contributing to Haystack! 🙏

⚠️ You currently have 3 open pull requests in this repository (#12533, #12480 and this one). Our review capacity is limited, so please hold off opening more PRs until we've had a chance to review your first 2 open PRs. This helps us give each contribution the attention it deserves. Thank you!

This is an automated message to help us keep the review queue healthy.

@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  haystack/components/retrievers
  filter_retriever.py
Project Total  

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

@sjrl sjrl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@sjrl
sjrl merged commit 86151b1 into deepset-ai:main Sep 7, 2026
25 of 26 checks passed
@sjrl sjrl self-assigned this Sep 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants