SIENTIAPDE-1171

Refactor model_repository and enhance test coverage for MLFlow functionalities

- Updated model_repository to ensure the 'temp' directory is created if it doesn't exist using `exist_ok=True`.
- Added new tests for retraining and updating production models, including error handling scenarios.
- Improved existing tests for model management workflows to ensure robustness and reliability.
This commit is contained in:
vitor-aignosi
2025-07-24 10:24:08 -03:00
parent 4283730e7a
commit c738e8b0df
4 changed files with 280 additions and 12 deletions

View File

@@ -168,8 +168,7 @@ class MLFlowRepository():
# dynamic parameters, including model itself
mlflow.sklearn.log_model(data_model, "data_model")
if not path.exists("temp"):
makedirs("temp")
makedirs("temp", exist_ok=True)
file_path = f"temp/raw_data_{model_name}.csv"
data.to_csv(file_path, index=True)