From 463b97f233395847d15f8896aac616b6ed32b977 Mon Sep 17 00:00:00 2001 From: Tatiana Al-Chueyr Date: Wed, 25 Oct 2023 22:25:01 +0100 Subject: [PATCH] Do not block Cosmos from work if there is a jinja issue in the Openlineage package https://github.com/astronomer/astronomer-cosmos/issues/612\#issuecomment-1777563297 Closes: #612 --- cosmos/operators/local.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cosmos/operators/local.py b/cosmos/operators/local.py index a593101fc..1c00f476c 100644 --- a/cosmos/operators/local.py +++ b/cosmos/operators/local.py @@ -11,6 +11,7 @@ import warnings import airflow +import jinja2 import yaml from airflow import DAG from airflow.compat.functools import cached_property @@ -283,7 +284,7 @@ def calculate_openlineage_events_completes( try: events = openlineage_processor.parse() self.openlineage_events_completes = events.completes - except (FileNotFoundError, NotImplementedError, ValueError, KeyError): + except (FileNotFoundError, NotImplementedError, ValueError, KeyError, jinja2.exceptions.UndefinedError): logger.debug("Unable to parse OpenLineage events", stack_info=True) def get_datasets(self, source: Literal["inputs", "outputs"]) -> list[Dataset]: