"""Task to update accounting_run.run_status to 'Error'.""" from lib.constants import ACCOUNTING_RUN_STATUSES from lib.utils import ows from tasks.accounting_run_calculate_nr import helpers def status_error(dag_run: dict, **kwargs) -> None: """Task to update accounting_run_status to 'Error'. 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) ows.update_accounting_run( event.target_id, accounting_run_status=ACCOUNTING_RUN_STATUSES.ERROR ) raise ValueError('Matching failed')