mirror of
https://github.com/datahub-project/datahub.git
synced 2025-12-29 10:57:52 +00:00
fix(airflow): add error handling around render_template() (#10907)
This commit is contained in:
parent
ff1c6b895e
commit
bb24651264
@ -362,8 +362,13 @@ class DataHubListener:
|
||||
|
||||
# Render templates in a copy of the task instance.
|
||||
# This is necessary to get the correct operator args in the extractors.
|
||||
task_instance = copy.deepcopy(task_instance)
|
||||
task_instance.render_templates()
|
||||
try:
|
||||
task_instance = copy.deepcopy(task_instance)
|
||||
task_instance.render_templates()
|
||||
except Exception as e:
|
||||
logger.info(
|
||||
f"Error rendering templates in DataHub listener. Jinja-templated variables will not be extracted correctly: {e}"
|
||||
)
|
||||
|
||||
# The type ignore is to placate mypy on Airflow 2.1.x.
|
||||
dagrun: "DagRun" = task_instance.dag_run # type: ignore[attr-defined]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user