From c19f505d62a51c1aadbac2d9c21ca638626d465c Mon Sep 17 00:00:00 2001 From: Max Marrone Date: Mon, 16 Dec 2024 19:02:25 -0500 Subject: [PATCH] robot-server: Avoid parse_obj_as() in migration. --- robot-server/robot_server/persistence/_migrations/up_to_3.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/robot-server/robot_server/persistence/_migrations/up_to_3.py b/robot-server/robot_server/persistence/_migrations/up_to_3.py index 73053d10391..b4382545dbf 100644 --- a/robot-server/robot_server/persistence/_migrations/up_to_3.py +++ b/robot-server/robot_server/persistence/_migrations/up_to_3.py @@ -23,7 +23,6 @@ from typing import List from opentrons.protocol_engine import StateSummary -import pydantic import sqlalchemy from ..pydantic import pydantic_to_json @@ -138,9 +137,7 @@ def _migrate_run_table_excluding_commands( new_state_summary = ( None if old_row.state_summary is None - else pydantic_to_json( - pydantic.parse_obj_as(StateSummary, old_state_summary) - ) + else pydantic_to_json(StateSummary.model_validate(old_state_summary)) ) dest_transaction.execute( insert_new_run,