"""Notify that adjustment file upload task has completed successfully.""" from lib import constants from lib.utils import ows from tasks.adjustment_file_upload import helpers def notify_success_task(dag_run: dict, **kwargs): """Update the 'upload_file' abacus_state status to 'complete'. Args: dag_run (dict): a dag's config """ event = helpers.get_event_from_params(dag_run, **kwargs) action_name = constants.STATEMENT_PERIOD_ADJUSTMENT_FILE_ACTIONS.UPLOAD_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 } )