Files
sientia-dataops-laborious_t…/laborious/activities/base.py
vitor-aignosi d09fb6ac5e SIENTIAPDE-994
Refactor activity methods and update requirements.txt to enhance functionality and remove deprecated filters. Added detailed docstrings for clarity and improved error handling in data processing workflows.
2025-05-09 16:27:57 -03:00

25 lines
940 B
Python

from temporalio import activity
from sientia_do.notifications.handlers import NotificationHandler
from logging import Logger
class BaseActivity:
def __init__(self, logger: Logger, notification_handler: NotificationHandler):
self.logger = logger
self.notification_handler = notification_handler
def prepare_activity(self, schedule_name: str,
model_name: str,
model_id: str):
"""
Prepare the activity for the notification handler.
Args:
schedule_name (str): The name of the schedule.
model_name (str): The name of the model.
model_id (str): The id of the model.
"""
self.notification_handler.base_notification.schedule_name = schedule_name
self.notification_handler.base_notification.model_name = model_name
self.notification_handler.base_notification.model_id = model_id