@@ -310,6 +310,7 @@ def read_inst_model(
310310 "framework" : query_result [0 ][0 ].framework ,
311311 }
312312
313+
313314@router .delete ("/{inst_id}/models/{model_name}" , response_model = ModelInfo )
314315def delete_model (
315316 inst_id : str ,
@@ -319,26 +320,23 @@ def delete_model(
319320 sql_session : Annotated [Session , Depends (get_session )],
320321 databricks_control : Annotated [DatabricksControl , Depends (DatabricksControl )],
321322) -> Any :
322-
323323 transformed_model_name = str (decode_url_piece (model_name )).strip ()
324324 has_access_to_inst_or_err (inst_id , current_user )
325325 model_owner_and_higher_or_err (current_user , "modify batch" )
326326
327327 local_session .set (sql_session )
328328 sess = local_session .get ()
329329
330- query_result = (
331- sess .execute (
332- select (InstTable ).where (
333- InstTable .id == str_to_uuid (inst_id )))
334- .all ()
335- )
330+ query_result = sess .execute (
331+ select (InstTable ).where (InstTable .id == str_to_uuid (inst_id ))
332+ ).all ()
336333
337334 model_list = sess .execute (
338- select (ModelTable .where (
339- ModelTable .name == str_to_uuid (model_name ),
340- ModelTable .inst_id == str_to_uuid (inst_id ),
341- )
335+ select (
336+ ModelTable .where (
337+ ModelTable .name == str_to_uuid (model_name ),
338+ ModelTable .inst_id == str_to_uuid (inst_id ),
339+ )
342340 )
343341 ).scalar_one_or_none ()
344342 if model_list is None :
@@ -362,6 +360,7 @@ def delete_model(
362360 "deleted_from_databricks" : delete_from_databricks ,
363361 }
364362
363+
365364@router .get ("/{inst_id}/models/{model_name}/runs" , response_model = list [RunInfo ])
366365def read_inst_model_outputs (
367366 inst_id : str ,
0 commit comments