"""Invoke abacus vat exempt lambda task method.""" from hooks.lambda_hook import OrchLambdaHook from lib import config from tasks.accounting_period_calculate_vat import helpers def invoke_vat_exempt_lambda_task(dag_run, *arg, **kwargs): """Invoke lambda to populate ledger_accounting_run_vat table.""" event = helpers.get_event_from_params(dag_run, **kwargs) hook = OrchLambdaHook(config.VAT_EXEMPT_LAMBDA_NAME) response = hook.invoke_lambda(event.to_json()) if not response.function_response.succeeded: raise Exception(response.error_message)