Skip to content

fix: skip None query input in QueryExpander - #12791

Merged
davidsbatista merged 2 commits into
deepset-ai:mainfrom
MohammadHijjawi97:fix/query-expander-none-query
Sep 22, 2026
Merged

davidsbatista merged 2 commits into
deepset-ai:mainfrom
MohammadHijjawi97:fix/query-expander-none-query

Conversation

@MohammadHijjawi97

Copy link
Copy Markdown
Contributor

Related Issues

No existing issue. This PR includes a regression test for the crash.

Proposed Changes:

Proposed Changes:

QueryExpander.run called query.strip() before checking the type. A None query from a pipeline raised AttributeError. Return an empty query list for None or non-string input, matching the existing empty-string warning path.

How did you test it?

Added unit tests for None query with and without include_original_query. Existing empty/whitespace tests still pass.

Notes for the reviewer

Checklist

  • I have read the contributors guidelines and the code of conduct.
  • I have updated the related issue with new insights and changes.
  • I have added unit tests and updated the docstrings.
  • I've used one of the conventional commit types for my PR title: fix:, feat:, build:, chore:, ci:, docs:, style:, refactor:, perf:, test: and added ! in case the PR includes breaking changes.
  • I have documented my code.
  • I have added a release note file, following the contributors guidelines.
  • I have run pre-commit hooks and fixed any issue.

QueryExpander.run called str.strip on query before checking its type. A None query from a pipeline raised AttributeError.

Co-authored-by: Cursor <cursoragent@cursor.com>
@MohammadHijjawi97
MohammadHijjawi97 requested a review from a team as a code owner September 17, 2026 11:05
@MohammadHijjawi97
MohammadHijjawi97 requested review from davidsbatista and removed request for a team September 17, 2026 11:05
@vercel

vercel Bot commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

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

A member of the Team first needs to authorize it.

@github-actions

Copy link
Copy Markdown
Contributor

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

⚠️ You currently have 5 open pull requests in this repository (#12794, #12793, #12792, #12790 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.

@HaystackBot

Copy link
Copy Markdown
Contributor

Hi @MohammadHijjawi97, thanks a lot for your contribution! 🙏

We noticed that the Contributor License Agreement (CLA) check (license/cla) hasn't passed yet, so we've temporarily moved this PR to draft and paused the review assignment.

To get your PR reviewed, please sign the CLA via the link in the license/cla check below (or in the CLA bot comment). As soon as the check turns green, this PR will automatically be marked ready for review again and a reviewer will be re-assigned.

@HaystackBot
HaystackBot removed the request for review from davidsbatista September 17, 2026 12:39
@HaystackBot HaystackBot added the cla-pending PR is in draft until the contributor signs the CLA label Sep 17, 2026
@HaystackBot
HaystackBot marked this pull request as draft September 17, 2026 12:39
@HaystackBot
HaystackBot marked this pull request as ready for review September 19, 2026 08:51
@HaystackBot HaystackBot removed the cla-pending PR is in draft until the contributor signs the CLA label Sep 19, 2026
@HaystackBot

Copy link
Copy Markdown
Contributor

Thanks for signing the CLA, @MohammadHijjawi97! 🎉 This PR is now ready for review again and the reviewer has been re-assigned.

@MohammadHijjawi97

Copy link
Copy Markdown
Contributor Author

CLA is signed now. This is ready for review whenever you have time.

@davidsbatista

Copy link
Copy Markdown
Contributor

I will review this at the appropriate time, but I kindly ask you to respect the warnings regarding the number of PRs open and not open more PRs until what you already have open is reviewed.

Not doing so will result in a permanent ban.

@vercel

vercel Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
haystack-docs Ready Ready Preview Sep 22, 2026 10:02am UTC

Request Review

@github-actions

Copy link
Copy Markdown
Contributor

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  haystack/components/query
  query_expander.py 272-273
Project Total  

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

@davidsbatista
davidsbatista merged commit 1e8663e into deepset-ai:main Sep 22, 2026
24 checks passed

This branch was successfully deployed

1 active deployment
Preview — 1bfec4e8 Deployed Sep 22, 2026 by vercel[bot]
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.

3 participants