3939
4040@read_router .get (
4141 '/schema' ,
42- response_model = dict ,
42+ response_model = dict [ str , t . Any ] ,
4343 responses = {
4444 422 : {'model' : errors .InvalidNodeTypeError },
4545 },
@@ -56,7 +56,7 @@ async def get_nodes_schema(
5656 t .Literal ['get' , 'post' ],
5757 Query (description = 'Type of schema to retrieve' ),
5858 ] = 'get' ,
59- ) -> dict :
59+ ) -> dict [ str , t . Any ] :
6060 """Get JSON schema for the base AiiDA node 'get' model."""
6161 if not node_type :
6262 return orm .Node .Model .model_json_schema ()
@@ -120,7 +120,7 @@ async def get_nodes(
120120 query .QueryParams ,
121121 Depends (query .query_params ),
122122 ],
123- ) -> PaginatedResults [orm . Node . Model ]:
123+ ) -> PaginatedResults [dict [ str , t . Any ] ]:
124124 """Get AiiDA nodes with optional filtering, sorting, and/or pagination."""
125125 return service .get_many (query_params )
126126
@@ -158,7 +158,7 @@ async def get_node_types() -> list:
158158 },
159159)
160160@with_dbenv ()
161- async def get_node (uuid : str ) -> orm . Node . Model :
161+ async def get_node (uuid : str ) -> dict [ str , t . Any ] :
162162 """Get AiiDA node by uuid."""
163163 return service .get_one (uuid )
164164
@@ -175,9 +175,9 @@ async def get_node(uuid: str) -> orm.Node.Model:
175175 },
176176)
177177@with_dbenv ()
178- async def get_node_user (uuid : str ) -> orm . User . Model :
178+ async def get_node_user (uuid : str ) -> dict [ str , t . Any ] :
179179 """Get the user associated with a node."""
180- return t . cast ( orm . User . Model , service .get_related_one (uuid , orm .User ) )
180+ return service .get_related_one (uuid , orm .User )
181181
182182
183183@read_router .get (
@@ -192,9 +192,9 @@ async def get_node_user(uuid: str) -> orm.User.Model:
192192 },
193193)
194194@with_dbenv ()
195- async def get_node_computer (uuid : str ) -> orm . Computer . Model :
195+ async def get_node_computer (uuid : str ) -> dict [ str , t . Any ] :
196196 """Get the computer associated with a node."""
197- return t . cast ( orm . Computer . Model , service .get_related_one (uuid , orm .Computer ) )
197+ return service .get_related_one (uuid , orm .Computer )
198198
199199
200200@read_router .get (
@@ -215,7 +215,7 @@ async def get_node_groups(
215215 query .QueryParams ,
216216 Depends (query .query_params ),
217217 ],
218- ) -> PaginatedResults [orm . Group . Model ]:
218+ ) -> PaginatedResults [dict [ str , t . Any ] ]:
219219 """Get the groups of a node."""
220220 return service .get_related_many (uuid , orm .Group , query_params )
221221
0 commit comments