mirror of
https://github.com/tiqi-group/pydase.git
synced 2025-04-22 01:00:02 +02:00
uses helper method in serializer
This commit is contained in:
parent
2898b62b9c
commit
6dd878a062
@ -14,6 +14,7 @@ from pydase.utils.helpers import (
|
|||||||
get_component_classes,
|
get_component_classes,
|
||||||
get_data_service_class_reference,
|
get_data_service_class_reference,
|
||||||
parse_full_access_path,
|
parse_full_access_path,
|
||||||
|
parse_serialized_key,
|
||||||
render_in_frontend,
|
render_in_frontend,
|
||||||
)
|
)
|
||||||
from pydase.utils.serialization.types import (
|
from pydase.utils.serialization.types import (
|
||||||
@ -453,17 +454,7 @@ def get_container_item_by_key(
|
|||||||
but is not, indicating a mismatch between expected and actual serialized
|
but is not, indicating a mismatch between expected and actual serialized
|
||||||
data structure.
|
data structure.
|
||||||
"""
|
"""
|
||||||
processed_key: int | float | str = key
|
processed_key = parse_serialized_key(key)
|
||||||
|
|
||||||
if key.startswith("["):
|
|
||||||
assert key.endswith("]")
|
|
||||||
processed_key = key[1:-1]
|
|
||||||
if '"' in processed_key or "'" in processed_key:
|
|
||||||
processed_key = processed_key[1:-1]
|
|
||||||
elif "." in processed_key:
|
|
||||||
processed_key = float(processed_key)
|
|
||||||
else:
|
|
||||||
processed_key = int(processed_key)
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
return get_or_create_item_in_container(
|
return get_or_create_item_in_container(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user