"""Task to update accounting_run.run_status to 'Complete'.""" from lib.constants import ACCOUNTING_RUN_STATUSES from lib.utils import ows from tasks.accounting_run_calculate_nr import helpers def status_complete(dag_run: dict, **kwargs) -> None: """Task to update accounting_run_status to 'Complete'. Args: dag_run (dict): config of the DAG this task belongs to kwargs (dict): any other optional arguments """ event = helpers.get_event_from_params(dag_run, **kwargs) update_json = { 'accounting_run_status': ACCOUNTING_RUN_STATUSES.COMPLETE, } ows.update_accounting_run(event.target_id, **update_json)