diff --git a/cosmos/operators/local.py b/cosmos/operators/local.py index f9e185085..335ce5e07 100644 --- a/cosmos/operators/local.py +++ b/cosmos/operators/local.py @@ -9,6 +9,7 @@ from typing import Any, Callable, Literal, Sequence, TYPE_CHECKING import airflow +import jinja2 import yaml from airflow import DAG from airflow.compat.functools import cached_property @@ -281,7 +282,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]: