SIENTIAPDE-1712

SIENTIAPDE-1712 Enhance logging across various classes by adding logger parameters and improving debug statements. This update includes adjustments in Gates, MLFlow, ModelMetrics, and MLFlowRepository classes for better traceability and observability during operations.
This commit is contained in:
vitor-aignosi
2026-04-01 13:53:23 -03:00
parent b9fe4604f7
commit 381856f5ca
9 changed files with 74 additions and 31 deletions

View File

@@ -541,6 +541,7 @@ async def test_format_prediction_no_timestamp(gates_activity):
'model_id': 'test_model',
'prediction_confidence': 0.9,
'prediction_store_policy': 'lts:1',
'timestamp': '2023-05-26 11:12:27',
}
# Act
@@ -580,6 +581,7 @@ async def test_format_prediction_with_timestamp_erl(gates_activity):
'model_id': 'test_model',
'prediction_confidence': 0.9,
'prediction_store_policy': 'erl:2',
'timestamp': '2023-05-26 11:12:27',
}
# Act
@@ -619,6 +621,7 @@ async def test_format_prediction_with_timestamp_lts(gates_activity):
'model_id': 'test_model',
'prediction_confidence': 0.9,
'prediction_store_policy': 'lts:2',
'timestamp': '2023-05-26 11:12:27',
}
# Act
@@ -655,6 +658,7 @@ async def test_format_prediction_with_timestamp_invalid_policy(gates_activity):
'model_id': 'test_model',
'prediction_confidence': 0.9,
'prediction_store_policy': 'lts:2',
'timestamp': '2023-05-26 11:12:27',
}
gates_activity.get_prediction_store_policy = MagicMock(return_value=('invalid', 1))

View File

@@ -181,6 +181,7 @@ async def test_request_transform_failure(mock_from_dataframe, mlflow):
status=transform_response,
workflow_metadata=metadata['metadata'],
last_timestamp=payload.last_timestamp,
logger=mlflow.logger,
)
assert response_data == mock_from_dataframe.return_value
@@ -252,6 +253,7 @@ async def test_request_predict_failure(mock_to_datetime, mock_from_dataframe, ml
status=predict_response,
workflow_metadata=metadata['metadata'],
last_timestamp=payload.last_timestamp,
logger=mlflow.logger,
)
assert response_data == mock_from_dataframe.return_value