This is an automated email from the ASF dual-hosted git repository.

mobuchowski pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 6041b77666a Fix OpenLineage macro _get_logical_date (#51210)
6041b77666a is described below

commit 6041b77666a582a1659d1d1efeaf27b53425ef6a
Author: Anand Raman <[email protected]>
AuthorDate: Fri May 30 04:06:41 2025 -0500

    Fix OpenLineage macro _get_logical_date (#51210)
    
    * change hasattr to get
    
    * update to else
---
 .../openlineage/src/airflow/providers/openlineage/plugins/macros.py     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/providers/openlineage/src/airflow/providers/openlineage/plugins/macros.py 
b/providers/openlineage/src/airflow/providers/openlineage/plugins/macros.py
index 5fd47b418c9..8cae51cb744 100644
--- a/providers/openlineage/src/airflow/providers/openlineage/plugins/macros.py
+++ b/providers/openlineage/src/airflow/providers/openlineage/plugins/macros.py
@@ -127,7 +127,7 @@ def _get_logical_date(task_instance):
         context = task_instance.get_template_context()
         if hasattr(task_instance, "dag_run"):
             dag_run = task_instance.dag_run
-        elif hasattr(context, "dag_run"):
+        else:
             dag_run = context["dag_run"]
         if hasattr(dag_run, "logical_date") and dag_run.logical_date:
             date = dag_run.logical_date

Reply via email to