Skip to content

fix(evals): tolerate null evaluatorConfig in evaluator creation#1713

Closed
ajay-kesavan wants to merge 2 commits into
mainfrom
fix/tolerate-null-evaluator-config
Closed

fix(evals): tolerate null evaluatorConfig in evaluator creation#1713
ajay-kesavan wants to merge 2 commits into
mainfrom
fix/tolerate-null-evaluator-config

Conversation

@ajay-kesavan

Copy link
Copy Markdown

Problem

The C# layer (EvaluatorConfigDto.EvaluatorConfig is JsonElement?) sends evaluatorConfig: null when the config is omitted. The name/description merge in GenericBaseEvaluator.validate_model then does:

values["evaluatorConfig"]["name"] = values.pop("name")  # None["name"] -> TypeError

which crashes with TypeError: 'NoneType' object does not support item assignment. Every evaluator fails at creation time, so eval runs die with 0 evals / Failed before any evaluation executes.

Fix

Treat a null evaluatorConfig as {} (3 lines in validate_model). Config fields all have defaults (default_evaluation_criteria becomes None), so the existing criteria fallback chain — per-item criteria → config default_evaluation_criteria — keeps working unchanged.

Testing

  • Two regression tests in tests/evaluators/test_evaluator_factory.py covering evaluatorConfig: null with top-level name and description
  • pytest tests/evaluators/ — 92 passed
  • ruff check + format clean

🤖 Generated with Claude Code

The C# layer (EvaluatorConfigDto) sends evaluatorConfig: null when omitted.
The name/description merge in GenericBaseEvaluator.validate_model then crashes
with TypeError ('NoneType' object does not support item assignment), failing
every evaluator at creation time and killing the run with 0 evals.

Treat a null evaluatorConfig as {} so config defaults apply and the existing
criteria fallback chain (item criteria -> config default) works.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 12, 2026 03:01
@github-actions github-actions Bot added test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-integrations labels Jun 12, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 fixes evaluator instantiation failures when the C# layer sends evaluatorConfig: null by normalizing null configs to {} during Pydantic model validation, preventing TypeError during name/description merging and allowing eval runs to proceed.

Changes:

  • Normalize evaluatorConfig: null to {} in GenericBaseEvaluator.validate_model before merging top-level name/description.
  • Add regression tests covering evaluator creation when evaluatorConfig is explicitly null and name/description are provided at the top level.

Reviewed changes

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

File Description
packages/uipath/src/uipath/eval/evaluators/base_evaluator.py Treats evaluatorConfig: null as {} during pre-validation to avoid crashes when merging metadata.
packages/uipath/tests/evaluators/test_evaluator_factory.py Adds tests to ensure evaluator creation tolerates evaluatorConfig: None with top-level name/description.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +124 to 128
# The C# layer sends evaluatorConfig: null when omitted — treat as {}
if values.get("evaluatorConfig", {}) is None:
values["evaluatorConfig"] = {}
if "description" in values and "evaluatorConfig" in values:
values["evaluatorConfig"]["description"] = values.pop("description")
2.10.81 is already published to PyPI; CI version-uniqueness check requires
a free version for this change.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

🚨 Heads up: uipath-langchain cross-tests are FAILING 🚨

Your changes may break the uipath-langchain-python integration.

⚠️ These checks are NOT enforced by branch protection rules. Please review the failures before merging.

🔍 Inspect the failed run →

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

Labels

test:uipath-integrations test:uipath-langchain Triggers tests in the uipath-langchain-python repository

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants