diff --git a/robot-server/robot_server/runs/run_store.py b/robot-server/robot_server/runs/run_store.py index 446a7a96482..3094b73b8ba 100644 --- a/robot-server/robot_server/runs/run_store.py +++ b/robot-server/robot_server/runs/run_store.py @@ -20,7 +20,7 @@ CommandErrorSlice, CommandStatus, ) -from opentrons.protocol_engine.commands import Command +from opentrons.protocol_engine.commands import Command, CommandAdapter from opentrons.protocol_engine.types import RunTimeParameter from opentrons_shared_data.errors.exceptions import ( @@ -51,6 +51,8 @@ _CACHE_ENTRIES = 32 +_rtp_list_adapter = TypeAdapter(list[RunTimeParameter]) + @dataclass(frozen=True) class RunResource: @@ -828,13 +830,9 @@ def _convert_state_to_sql_values( } -_command_type_adapter: TypeAdapter[Command] = TypeAdapter(Command) -_rtp_list_adapter = TypeAdapter(list[RunTimeParameter]) - - def _parse_command(json_str: str) -> Command: """Parse a JSON string from the database into a `Command`.""" - return json_to_pydantic(_command_type_adapter, json_str) + return json_to_pydantic(CommandAdapter, json_str) def _convert_commands_status_to_sql_command_status(