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

uranusjr 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 1159133  Crerate TI context with data interval compat layer (#19148)
1159133 is described below

commit 1159133040b3513bcc88921823fa001e9773276d
Author: Tzu-ping Chung <[email protected]>
AuthorDate: Fri Oct 22 14:50:22 2021 +0800

    Crerate TI context with data interval compat layer (#19148)
---
 airflow/models/taskinstance.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/airflow/models/taskinstance.py b/airflow/models/taskinstance.py
index b9745cc..6289eca 100644
--- a/airflow/models/taskinstance.py
+++ b/airflow/models/taskinstance.py
@@ -1776,6 +1776,7 @@ class TaskInstance(Base, LoggingMixin):
         integrate_macros_plugins()
 
         dag_run = self.get_dagrun(session)
+        data_interval = dag.get_run_data_interval(dag_run)
 
         params = ParamsDict(suppress_exception=ignore_param_exceptions)
 
@@ -1996,8 +1997,8 @@ class TaskInstance(Base, LoggingMixin):
             'conf': conf,
             'dag': dag,
             'dag_run': dag_run,
-            'data_interval_end': 
timezone.coerce_datetime(dag_run.data_interval_end),
-            'data_interval_start': 
timezone.coerce_datetime(dag_run.data_interval_start),
+            'data_interval_end': timezone.coerce_datetime(data_interval.end),
+            'data_interval_start': 
timezone.coerce_datetime(data_interval.start),
             'ds': ds,
             'ds_nodash': ds_nodash,
             'execution_date': deprecated_proxy(

Reply via email to