Skip to content

Commit ea15b2f

Browse files
committed
fix(tests): fix legacy config tests
Signed-off-by: Anna Warno <[email protected]>
1 parent 2eed38c commit ea15b2f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

packages/nemo-evaluator/src/nemo_evaluator/adapters/adapter_config.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -420,9 +420,12 @@ def from_legacy_config(
420420
logger = get_logger(__name__)
421421

422422
# Validate legacy config using Pydantic model (catches typos early)
423-
# The model includes all defaults, so no need to merge separately
423+
# Filter out modern fields (discovery, interceptors, post_eval_hooks) before validation
424+
modern_fields = {"discovery", "interceptors", "post_eval_hooks"}
425+
legacy_only = {k: v for k, v in legacy_config.items() if k not in modern_fields}
426+
424427
try:
425-
validated = LegacyAdapterConfig(**legacy_config)
428+
validated = LegacyAdapterConfig(**legacy_only)
426429
legacy_config = validated.model_dump()
427430
except ValidationError:
428431
# Log helpful message with list of valid fields

0 commit comments

Comments
 (0)