Skip to content

[Evaluation] Fix unhashable list crash in binary aggregation#46743

Open
mmkawale wants to merge 5 commits intoAzure:mainfrom
mmkawale:fix/eval-binary-aggregation-unhashable
Open

[Evaluation] Fix unhashable list crash in binary aggregation#46743
mmkawale wants to merge 5 commits intoAzure:mainfrom
mmkawale:fix/eval-binary-aggregation-unhashable

Conversation

@mmkawale
Copy link
Copy Markdown

@mmkawale mmkawale commented May 6, 2026

Summary

Wrap value_counts().to_dict() in _aggregation_binary_output with try/except TypeError. Columns matching outputs.*_result whose values are unhashable (e.g. lists) are now skipped with a warning instead of aborting the entire evaluate() call with EvaluationException: (InternalError) unhashable type: 'list'.

Changes

  • Defensive try/except TypeError around value_counts().to_dict() in _aggregation_binary_output.
  • Added a unit test covering a mixed DataFrame (valid pass/fail column + list-valued column).
  • CHANGELOG entry under 1.16.7 (Unreleased).

Wrap value_counts().to_dict() in _aggregation_binary_output with try/except TypeError. Columns matching outputs.*_result whose values are unhashable (e.g. lists) are now skipped with a warning instead of aborting the entire evaluate() call with EvaluationException: (InternalError) unhashable type: 'list'.

Adds a unit test covering a mixed DataFrame (valid pass/fail column + list-valued column) and a CHANGELOG entry under 1.16.7 (Unreleased).
Copilot AI review requested due to automatic review settings May 6, 2026 00:46
@mmkawale mmkawale requested a review from a team as a code owner May 6, 2026 00:46
@github-actions github-actions Bot added Community Contribution Community members are working on the issue customer-reported Issues that are reported by GitHub users external to the Azure organization. Evaluation Issues related to the client library for Azure AI Evaluation labels May 6, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

Thank you for your contribution @mmkawale! We will review the pull request and get back to you soon.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR hardens evaluation metric aggregation in azure-ai-evaluation so malformed list-valued outputs.*_result columns no longer abort aggregation. It updates the binary aggregation path, adds a targeted unit test, and documents the fix in the package changelog.

Changes:

  • Wrapped binary _result aggregation in try/except TypeError so unhashable values are skipped with a warning instead of failing the run.
  • Added a unit test covering a valid binary result column alongside an unhashable list-valued _result column.
  • Added a 1.16.7 (Unreleased) changelog entry for the regression fix.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluate/_evaluate.py Adds defensive handling for unhashable _result values during binary aggregation.
sdk/evaluation/azure-ai-evaluation/tests/unittests/test_evaluate.py Adds unit coverage for skipping malformed list-valued _result columns without crashing aggregation.
sdk/evaluation/azure-ai-evaluation/CHANGELOG.md Documents the unhashable-list aggregation fix in the unreleased changelog section.

Comment thread sdk/evaluation/azure-ai-evaluation/tests/unittests/test_evaluate.py Outdated
@mmkawale
Copy link
Copy Markdown
Author

mmkawale commented May 6, 2026

@microsoft-github-policy-service agree [company="Microsoft"]

@mmkawale
Copy link
Copy Markdown
Author

mmkawale commented May 6, 2026

@microsoft-github-policy-service agree company="Microsoft"

@mmkawale mmkawale requested review from Copilot and posaninagendra May 6, 2026 05:19
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

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

Labels

Community Contribution Community members are working on the issue customer-reported Issues that are reported by GitHub users external to the Azure organization. Evaluation Issues related to the client library for Azure AI Evaluation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants