SIENTIAPDE-994

Implement new get_last_timestamp method in Gates class, refactor MLFlow activity methods to return only transformed data, and update PredictionsBatch and PredictionProcess workflows to utilize Activities module. Add detailed docstrings for new methods and enhance test coverage for get_last_timestamp functionality.
This commit is contained in:
vitor-aignosi
2025-05-12 11:36:21 -03:00
parent d09fb6ac5e
commit eb6d2dd79c
8 changed files with 540 additions and 83 deletions

View File

@@ -207,3 +207,16 @@ class Gates(BaseActivity):
'prediction_status': ['Bad'],
'comment': [input_data['comment']]
}).to_dict()
@activity.defn(name="get_last_timestamp")
async def get_last_timestamp(self, input_data: dict[str, Any]) -> str:
"""
Gets the last timestamp of the data.
Args:
input_data (dict): The input data. Contains:
data (dict[str, Any]): The data to get the last timestamp from.
Returns:
str: The last timestamp of the data.
"""
data = DataFrame(input_data['data'])
return max(data['timestamp'].values.tolist())