Skip to content

Fix TypeError when evaluator returns None score for skipped/not-applicable results#5107

Merged
vebudumu merged 1 commit into
mainfrom
vebudumu/fix-none-score-isnan
Jun 4, 2026
Merged

Fix TypeError when evaluator returns None score for skipped/not-applicable results#5107
vebudumu merged 1 commit into
mainfrom
vebudumu/fix-none-score-isnan

Conversation

@vebudumu
Copy link
Copy Markdown
Contributor

@vebudumu vebudumu commented Jun 4, 2026

When _return_not_applicable_result sets score=None (introduced in PR #5042), the math.isnan() check in _do_eval crashes with:
TypeError: must be real number, not NoneType

Guard math.isnan() with a None check so skipped/not-applicable results pass through correctly instead of raising an unhandled TypeError.

Affected evaluators: groundedness, coherence, fluency, retrieval, similarity.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 4, 2026

Test Results for assets-test

279 tests   279 ✅  9s ⏱️
  4 suites    0 💤
  4 files      0 ❌

Results for commit ba2c49f.

♻️ This comment has been updated with latest results.

Comment thread assets/evaluators/builtin/similarity/evaluator/_similarity.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants