Skip to content

Commit

Permalink
fix: Rebase leftover
Browse files Browse the repository at this point in the history
  • Loading branch information
alecandido committed Dec 19, 2024
1 parent 2376e29 commit e4ec32f
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/qibolab/_core/parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@
from collections.abc import Callable, Iterable
from typing import Annotated, Any, Union

from pydantic import BeforeValidator, Field, PlainSerializer, TypeAdapter
from pydantic import (
BeforeValidator,
Field,
PlainSerializer,
TypeAdapter,
ValidationError,
)
from pydantic_core import core_schema
from typing_extensions import NotRequired, TypedDict

Expand Down Expand Up @@ -48,7 +54,12 @@ def update_configs(configs: dict[str, Config], updates: list[ConfigUpdate]):
for update in updates:
for name, changes in update.items():
if name not in configs:
configs[name] = a.validate_python(changes)
try:
configs[name] = a.validate_python(changes)
except ValidationError:
raise ValueError(
f"Cannot update configuration for unknown component {name}"
)
configs[name] = replace(configs[name], **changes)


Expand Down

0 comments on commit e4ec32f

Please sign in to comment.