SIENTIAPDE-1646
Refactor MLFlow retraining logic to always use retrain method - Removed the conditional logic for full retraining, ensuring the `retrain` method is always called. - Updated the documentation in the `retrain_model` method to reflect the changes in retraining flow. - Adjusted tests to verify that the `retrain` method is invoked correctly, while ensuring `train` is not called when the full retrain flag is set.
This commit is contained in:
@@ -477,7 +477,7 @@ async def test_retrain_model_success_with_payload_data(
|
||||
@patch('laborious.activities.mlflow.tempfile.mkdtemp')
|
||||
@patch('laborious.activities.mlflow.rmtree')
|
||||
@patch('laborious.activities.mlflow.to_datetime')
|
||||
async def test_retrain_model_success_full_retrain_branch(
|
||||
async def test_retrain_model_always_uses_retrain_even_with_full_retrain_flag(
|
||||
mock_to_datetime, mock_rmtree, mock_mkdtemp, mock_log_artifact, mlflow
|
||||
):
|
||||
mock_mkdtemp.return_value = 'tmp'
|
||||
@@ -510,7 +510,8 @@ async def test_retrain_model_success_full_retrain_branch(
|
||||
}
|
||||
)
|
||||
|
||||
wrapper.train.assert_called_once()
|
||||
wrapper.retrain.assert_called_once()
|
||||
wrapper.train.assert_not_called()
|
||||
assert response['success'] is True
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user