File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed
packages/models-library/src/models_library Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -335,7 +335,7 @@ class DynamicSidecarServiceLabels(BaseModel):
335335 callbacks_mapping : Annotated [
336336 Json [CallbacksMapping ] | None ,
337337 Field (
338- default_factory = CallbacksMapping , # this one ANE I am not sure about
338+ default_factory = CallbacksMapping , # NOTE: PC-> ANE I still think this could be an issue
339339 alias = "simcore.service.callbacks-mapping" ,
340340 description = "exposes callbacks from user services to the sidecar" ,
341341 ),
Original file line number Diff line number Diff line change 44from common_library .pydantic_fields_extension import get_type
55from pydantic import BaseModel , Field
66from pydantic ._internal ._model_construction import ModelMetaclass
7+ from pydantic .fields import FieldInfo
78
89from .services import ServiceKey , ServiceVersion
910from .utils .enums import StrAutoEnum
@@ -74,11 +75,12 @@ def get_preference_name(cls) -> PreferenceName:
7475
7576 @classmethod
7677 def get_default_value (cls ) -> Any :
77- # ANE: please double check this concept
78+ value_field : FieldInfo = dict (cls .model_fields )["value" ]
79+
7880 return (
79- cls . model_fields [ "value" ] .default_factory () # type: ignore[call-arg]
80- if cls . model_fields [ "value" ]. default_factory is not None
81- else cls . model_fields [ "value" ] .default
81+ value_field .default_factory () # type: ignore[call-arg]
82+ if callable ( value_field . default_factory )
83+ else value_field .default
8284 )
8385
8486
You can’t perform that action at this time.
0 commit comments