Skip to content

Fill target errors with nans for evaluate #41919

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 40 commits into
base: main
Choose a base branch
from
Open
Changes from 37 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
4318329
Prepare evals SDK Release
May 28, 2025
192b980
Fix bug
May 28, 2025
758adb4
Fix for ADV_CONV for FDP projects
May 29, 2025
de09fd1
Update release date
May 29, 2025
ef60fe6
Merge branch 'main' into main
nagkumar91 May 29, 2025
8ca51d0
Merge branch 'Azure:main' into main
nagkumar91 May 30, 2025
98bfc3a
Merge branch 'Azure:main' into main
nagkumar91 Jun 2, 2025
a5f32e8
Merge branch 'Azure:main' into main
nagkumar91 Jun 9, 2025
5fd88b6
Merge branch 'Azure:main' into main
nagkumar91 Jun 10, 2025
51f2b44
Merge branch 'Azure:main' into main
nagkumar91 Jun 10, 2025
a5be8b5
Merge branch 'Azure:main' into main
nagkumar91 Jun 16, 2025
75965b7
Merge branch 'Azure:main' into main
nagkumar91 Jun 25, 2025
d0c5e53
Merge branch 'Azure:main' into main
nagkumar91 Jun 25, 2025
b790276
Merge branch 'Azure:main' into main
nagkumar91 Jun 26, 2025
d5ca243
Merge branch 'Azure:main' into main
nagkumar91 Jun 26, 2025
8d62e36
re-add pyrit to matrix
Jun 26, 2025
59a70f2
Change grader ids
Jun 26, 2025
4d146d7
Merge branch 'Azure:main' into main
nagkumar91 Jun 26, 2025
f7a4c83
Update unit test
Jun 27, 2025
79e3a40
replace all old grader IDs in tests
Jun 27, 2025
588cbec
Merge branch 'main' into main
nagkumar91 Jun 30, 2025
7514472
Update platform-matrix.json
nagkumar91 Jun 30, 2025
28b2513
Update test to ensure everything is mocked
Jul 1, 2025
8603e0e
tox/black fixes
Jul 1, 2025
895f226
Skip that test with issues
Jul 1, 2025
b4b2daf
Merge branch 'Azure:main' into main
nagkumar91 Jul 1, 2025
023f07f
update grader ID according to API View feedback
Jul 1, 2025
45b5f5d
Update test
Jul 2, 2025
1ccb4db
remove string check for grader ID
Jul 2, 2025
6fd9aa5
Merge branch 'Azure:main' into main
nagkumar91 Jul 2, 2025
f871855
Update changelog and officialy start freeze
Jul 2, 2025
59ac230
update the enum according to suggestions
Jul 2, 2025
794a2c4
update the changelog
Jul 2, 2025
b33363c
Finalize logic
Jul 2, 2025
464e2dd
Merge branch 'Azure:main' into main
nagkumar91 Jul 3, 2025
98dc816
Fill the dataset when target doesn't respond with all columns
Jul 4, 2025
3943344
Tox fixes
Jul 4, 2025
7504164
Send dataframe instead of previous run
Jul 7, 2025
9f3d5bc
tox fixes
Jul 7, 2025
610f97f
Add a test
Jul 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -611,13 +611,32 @@ def _apply_target_to_data(
category=ErrorCategory.FAILED_EXECUTION,
blame=ErrorBlame.USER_ERROR,
)

# Log a warning if some rows failed
failed_lines = run_summary.get("failed_lines", 0)
completed_lines = run_summary["completed_lines"]
total_lines = failed_lines + completed_lines

if failed_lines > 0:
LOGGER.warning(
f"Target function completed {completed_lines} out of {total_lines} rows. "
f"{failed_lines} rows failed and will be filled with NaN values."
)

# Remove input and output prefix
generated_columns = {
col[len(Prefixes.OUTPUTS) :] for col in target_output.columns if col.startswith(Prefixes.OUTPUTS)
}
# Sort output by line numbers
target_output.set_index(f"inputs.{LINE_NUMBER}", inplace=True)
target_output.sort_index(inplace=True)

initial_data_with_line_numbers = initial_data.copy()
initial_data_with_line_numbers[LINE_NUMBER] = range(len(initial_data))

complete_index = initial_data_with_line_numbers[LINE_NUMBER]
target_output = target_output.reindex(complete_index)

target_output.reset_index(inplace=True, drop=False)
# target_output contains only input columns, taken by function,
# so we need to concatenate it to the input data frame.
Expand All @@ -626,8 +645,8 @@ def _apply_target_to_data(
# Rename outputs columns to __outputs
rename_dict = {col: col.replace(Prefixes.OUTPUTS, Prefixes.TSG_OUTPUTS) for col in target_output.columns}
target_output.rename(columns=rename_dict, inplace=True)
# Concatenate output to input
target_output = pd.concat([target_output, initial_data], axis=1)
# Concatenate output to input - now both dataframes have the same number of rows
target_output = pd.concat([initial_data, target_output], axis=1)

return target_output, generated_columns, run

Expand Down