Skip to content

Bugfix/aoai row mismatch #42466

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 76 commits into
base: main
Choose a base branch
from

Conversation

nagkumar91
Copy link
Member

Description

Please add an informative description that covers that changes made by the pull request and link all relevant issues.

If an SDK is being regenerated based on a new API spec, a link to the pull request containing these API spec changes should be included above.

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

@github-actions github-actions bot added the Evaluation Issues related to the client library for Azure AI Evaluation label Aug 11, 2025
@nagkumar91 nagkumar91 marked this pull request as ready for review August 11, 2025 22:42
@Copilot Copilot AI review requested due to automatic review settings August 11, 2025 22:42
@nagkumar91 nagkumar91 requested a review from a team as a code owner August 11, 2025 22:42
Copy link
Contributor

@Copilot 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 pull request fixes a critical bug in the Azure AI evaluation system where evaluation results were not properly aligned with input data, leading to incorrect metrics being reported. The issue occurred because AOAI (Azure OpenAI) evaluation runs could return results in a different order than the original dataset or drop some rows entirely.

Key changes:

  • Added row alignment validation by tracking expected row count
  • Enhanced result processing to handle missing rows with proper padding
  • Updated test cases to validate ordering preservation and missing row handling

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
test_aoai_evaluation_pagination.py Updated test cases to include expected_rows parameter and fixed test data to properly validate row ordering
test_aoai_alignment_missing_rows.py New test file to validate proper handling of unordered AOAI results and missing row detection
_evaluate_aoai.py Core fix implementing row alignment validation, missing row padding, and proper result ordering
CHANGELOG.md Documentation of the bug fix

if expected is not None:
pre_len = len(output_df)
# Assumes original datasource_item_id space is 0..expected-1
output_df = output_df.reindex(range(expected))
Copy link
Contributor

Choose a reason for hiding this comment

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

How do we know for which row we did not get result ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Evaluation Issues related to the client library for Azure AI Evaluation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants