2727 get_columns_spec ,
2828 get_dataset_info ,
2929)
30- from DashAI .back .dependencies .database .models import Dataset , Experiment
30+ from DashAI .back .dependencies .database .models import Dataset , ModelSession
3131from DashAI .back .types .inf .type_inference import infer_types
3232from DashAI .back .types .type_validation import validate_multiple_type_changes
3333from DashAI .back .types .utils import arrow_to_dashai_schema
@@ -506,13 +506,13 @@ async def get_info(
506506 return info
507507
508508
509- @router .get ("/{dataset_id}/experiments -exist" )
509+ @router .get ("/{dataset_id}/model-sessions -exist" )
510510@inject
511- async def get_experiments_exist (
511+ async def get_model_sessions_exist (
512512 dataset_id : int ,
513513 session_factory : sessionmaker = Depends (lambda : di ["session_factory" ]),
514514):
515- """Get a boolean indicating if there are experiments associated with the dataset.
515+ """Get a boolean indicating if there are model sessions associated with the dataset.
516516
517517 Parameters
518518 ----------
@@ -522,7 +522,7 @@ async def get_experiments_exist(
522522 Returns
523523 -------
524524 bool
525- True if there are experiments associated with the dataset, False otherwise.
525+ True if there are model sessions associated with the dataset, False otherwise.
526526 """
527527 with session_factory () as db :
528528 try :
@@ -539,13 +539,15 @@ async def get_experiments_exist(
539539 detail = "Dataset is not in finished state" ,
540540 )
541541
542- # Check if there are any experiments associated with the dataset
543- experiments_exist = (
544- db .query (Experiment ).filter (Experiment .dataset_id == dataset_id ).first ()
542+ # Check if there are any model sessions associated with the dataset
543+ model_sessions_exist = (
544+ db .query (ModelSession )
545+ .filter (ModelSession .dataset_id == dataset_id )
546+ .first ()
545547 is not None
546548 )
547549
548- return experiments_exist
550+ return model_sessions_exist
549551
550552 except exc .SQLAlchemyError as e :
551553 logger .exception (e )
0 commit comments