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:
Bruno Domingues
2026-02-19 21:13:41 -03:00
parent f952647cf6
commit 41c4490cad
5 changed files with 56 additions and 33 deletions

View File

@@ -51,6 +51,12 @@ TEST_SCENARIOS_DIR = PROJECT_ROOT / 'docs' / 'test-scenarios'
MINIO_ALIAS = 'suse'
MINIO_BUCKET = 'model-training'
# Mapeamento de CSV específico por cenário
SCENARIO_CSV_MAPPING = {
'12-angular-test-date-format': Path('docs/DB_CV022_WIT230.csv'),
'13-angular-test-double-date-column': Path('docs/DB_CV022_WIT230 _double_date_column.csv'),
}
POSTGRES_CONFIG = {
'host': os.getenv('POSTGRES_HOST'),
'port': os.getenv('POSTGRES_PORT'),
@@ -306,6 +312,10 @@ def run_local_pipeline(
result['error'] = str(exc)
return result
# Use scenario-specific CSV if mapped, otherwise use provided csv_path
if scenario_name in SCENARIO_CSV_MAPPING:
csv_path = SCENARIO_CSV_MAPPING[scenario_name]
csv_path = _resolve_csv_path(csv_path)
_ensure_source_file(csv_path)
payload = _build_local_payload(request_data, csv_path)
@@ -450,6 +460,11 @@ def run_single_scenario(scenario_name: str, csv_path: Path) -> dict:
result['error'] = str(exc)
return result
# Use scenario-specific CSV if mapped, otherwise use provided csv_path
if scenario_name in SCENARIO_CSV_MAPPING:
csv_path = SCENARIO_CSV_MAPPING[scenario_name]
print(f' Using scenario-specific CSV: {csv_path}')
csv_path = _resolve_csv_path(csv_path)
# Upload CSV to MinIO