SIENTIAPDE-1579: Fix SientiaMlException propagation in ModelServing.search_runs_by_name to correctly raise the exception with its message, resolving a TypeError. Enhance training test script to support scenario-specific CSV files for different test cases. Update search_runs_by_name return type hint and apply minor code formatting.
This commit is contained in:
@@ -56,7 +56,7 @@ class ModelServing:
|
||||
# Function to list runs for a given experiment
|
||||
def search_runs_by_name(
|
||||
self, experiment_names: list[str], order_by: None | list[str] = None
|
||||
) -> pd.DataFrame:
|
||||
) -> pd.DataFrame | list:
|
||||
"""
|
||||
List runs for a specified MLflow experiment.
|
||||
|
||||
@@ -64,7 +64,7 @@ class ModelServing:
|
||||
experiment_names (list[str]): List with experiment_names to retrieve runs from.
|
||||
|
||||
Returns:
|
||||
pandas.DataFrame: A DataFrame containing run information.
|
||||
Union[pd.DataFrame, list]: A DataFrame or list containing run information.
|
||||
|
||||
Raises:
|
||||
SientiaMlException: If unable to search runs.
|
||||
@@ -73,7 +73,7 @@ class ModelServing:
|
||||
runs = mlflow.search_runs(experiment_names=experiment_names, order_by=order_by)
|
||||
except SientiaMlException as e:
|
||||
logging.error(e)
|
||||
raise SientiaMlException from e
|
||||
raise SientiaMlException(str(e)) from e
|
||||
return runs
|
||||
|
||||
def set_experiment(self, experiment_identifier: str) -> None:
|
||||
|
||||
Reference in New Issue
Block a user