SIENTIAPDE-1182

Implement prediction store policy handling in Gates activity

- Added a new method `get_prediction_store_policy` to validate and parse the prediction store policy.
- Updated `format_prediction` method to utilize the new policy handling, allowing for sorting of predictions based on the specified policy.
- Enhanced test coverage for the new policy handling, including various scenarios for valid and invalid policies.
- Removed the obsolete `coverage.sh` script.
This commit is contained in:
2025-08-28 16:31:55 -03:00
parent 7f3ecc9add
commit 30c1d6746a
6 changed files with 201 additions and 8 deletions

View File

@@ -82,7 +82,8 @@ async def test_request_transform(mock_max, mock_dataframe, mlflow):
}
# Mock the transform response
expected_response = {'prediction': [0.5, 0.6]}
expected_response = {'prediction': [0.5, 0.6], 'timestamp': [
'2024-01-01', '2024-01-02']}
mlflow.model_monitoring_repository.transform.return_value = expected_response
mock_dataframe.return_value.sort_values.return_value = mock_dataframe.return_value
@@ -98,7 +99,7 @@ async def test_request_transform(mock_max, mock_dataframe, mlflow):
)
mock_dataframe = mock_dataframe.return_value.pivot.return_value
mock_dataframe.fillna.assert_called_once_with(np.nan, inplace=True)
mock_dataframe.reset_index.assert_called_once()
# mock_dataframe.reset_index.assert_called_once()
mock_dataframe.columns.name = None
# Verify the response