"""Notify that reserves_release task success.""" from lib import constants from lib.utils import ows from tasks.reserves_release 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_ACTIONS.RELEASE_RESERVES abacus_state = helpers.get_action_state( event.target_id, action_name ) ows.update_abacus_state( abacus_state.get('abacus_state_id'), body=dict( action_status=constants.ABACUS_STATE_STATUSES.COMPLETE ) )