Skip to content

fix: NvidiaRanker reordered the top_k fallback to happen after validation - #3749

Open
davidsbatista wants to merge 1 commit into
mainfrom
fix/nvidia-ranker-top-k-zero
Open

fix: NvidiaRanker reordered the top_k fallback to happen after validation#3749
davidsbatista wants to merge 1 commit into
mainfrom
fix/nvidia-ranker-top-k-zero

Conversation

@davidsbatista

Copy link
Copy Markdown
Contributor

Related Issues

Proposed Changes:

  • Added missing init-time top_k <= 0 validation.
  • Breaking Change: runtime top_k <= 0 now raises ValueError instead of logging a warning and returning [].

How did you test it?

  • Replaced test_top_k_warn, now raises before reaching the pytest.warns block) with:
    • test_top_k_init_invalid, test_top_k_run_invalid (both parametrized over [0, -1])
    • test_top_k_zero_at_run_does_not_fall_back_to_instance_top_k.

Checklist

@github-actions github-actions Bot added integration:nvidia type:documentation Improvements or additions to documentation labels Aug 7, 2026
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Coverage report (nvidia)

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  integrations/nvidia/src/haystack_integrations/components/rankers/nvidia
  ranker.py
Project Total  

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

@davidsbatista
davidsbatista marked this pull request as ready for review August 10, 2026 08:44
@davidsbatista
davidsbatista requested a review from a team as a code owner August 10, 2026 08:44
@davidsbatista
davidsbatista requested review from sjrl and removed request for a team August 10, 2026 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration:nvidia type:documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant