File tree Expand file tree Collapse file tree 3 files changed +3
-21
lines changed
src/simcore_service_director_v2/models Expand file tree Collapse file tree 3 files changed +3
-21
lines changed Original file line number Diff line number Diff line change 44import networkx as nx
55from models_library .projects import ProjectID
66from models_library .projects_state import RunningState
7- from pydantic import (
8- BaseModel ,
9- ConfigDict ,
10- SerializationInfo ,
11- field_serializer ,
12- field_validator ,
13- )
7+ from pydantic import BaseModel , ConfigDict , field_validator
148from simcore_postgres_database .models .comp_pipeline import StateType
159
1610from ..utils .db import DB_TO_RUNNING_STATE
@@ -21,13 +15,6 @@ class CompPipelineAtDB(BaseModel):
2115 dag_adjacency_list : dict [str , list [str ]] # json serialization issue if using NodeID
2216 state : RunningState
2317
24- @field_serializer ("project_id" )
25- @staticmethod
26- def _convert_uuid_to_str (v : ProjectID , info : SerializationInfo ) -> str | ProjectID :
27- if info .context == "asyncpg" :
28- return f"{ v } "
29- return v
30-
3118 @field_validator ("state" , mode = "before" )
3219 @classmethod
3320 def _convert_state_from_state_type_enum_if_needed (cls , v ):
Original file line number Diff line number Diff line change @@ -52,15 +52,10 @@ async def _(**pipeline_kwargs) -> CompPipelineAtDB:
5252 "state" : StateType .NOT_STARTED ,
5353 }
5454 pipeline_config .update (** pipeline_kwargs )
55- CompPipelineAtDB .model_validate (pipeline_config ).model_dump (context = "asyncpg" )
5655 async with sqlalchemy_async_engine .begin () as conn :
5756 result = await conn .execute (
5857 comp_pipeline .insert ()
59- .values (
60- ** CompPipelineAtDB .model_validate (pipeline_config ).model_dump (
61- context = "asyncpg"
62- )
63- )
58+ .values (** pipeline_config )
6459 .returning (sa .literal_column ("*" ))
6560 )
6661 assert result
Original file line number Diff line number Diff line change @@ -101,7 +101,7 @@ async def tasks(
101101 create_tasks : Callable [..., Awaitable [list [CompTaskAtDB ]]],
102102) -> list [CompTaskAtDB ]:
103103 await create_pipeline (
104- project_id = project .uuid ,
104+ project_id = f" { project .uuid } " ,
105105 dag_adjacency_list = fake_workbench_adjacency ,
106106 )
107107 comp_tasks = await create_tasks (user , project )
You can’t perform that action at this time.
0 commit comments