"""Notify that apply_pending_adjustments task success.""" from lib import constants from lib.utils import ows from tasks.apply_pending_adjustments import helpers def notify_success_task(dag_run, **kwargs): """Update specified action state's action_status to 'complete'.""" event = helpers.get_event_from_params(dag_run, **kwargs) action_name = constants.STATEMENT_PERIOD_ADJUSTMENT_FILE_ACTIONS.APPLY_FILE abacus_state = helpers.get_abacus_state(action_name, event.target_id) ows.update_abacus_state( abacus_state.get('abacus_state_id'), body={ 'action_status': constants.ABACUS_STATE_STATUSES.COMPLETE } )