"""Helper methods for the NR accounting_run_calculate DAG.""" from lib import constants from lib.abacus_event import AbacusEvent from lib.utils import event def get_event_from_params(dag_run: dict, **kwargs) -> AbacusEvent: """Get the abacus_event from params passed into task callbacks.""" abacus_event = event.get_abacus_event(dag_run, **kwargs) event.validate_event_for_handler( abacus_event, target_type=constants.DAG_CALC_TARGET_TYPE, event_name=constants.DAG_NR_CALC_EVENT_NAME ) return abacus_event