Lee-W commented on code in PR #39585:
URL: https://github.com/apache/airflow/pull/39585#discussion_r1634496180


##########
airflow/models/taskinstance.py:
##########
@@ -3000,12 +3019,12 @@ def _execute_task(self, context: Context, task_orig: 
Operator):
         return _execute_task(self, context, task_orig)
 
     @provide_session
-    def defer_task(self, exception: TaskDeferred, session: Session) -> None:
-        """Mark the task as deferred and sets up the trigger that is needed to 
resume it.
+    def defer_task(self, exception: TaskDeferred | None = None, session: 
Session = NEW_SESSION) -> None:
+        """Mark the task as deferred and sets up the trigger that is needed to 
resume it when TaskDeferred is raised.
 
         :meta: private
         """
-        _defer_task(ti=self, exception=exception, session=session)
+        _defer_task(ti=self, session=session, exception=exception)

Review Comment:
   Updated. Thanks!



##########
airflow/serialization/pydantic/taskinstance.py:
##########
@@ -499,7 +499,7 @@ def _register_dataset_changes(self, *, events, session: 
Session | None = None) -
 
     def defer_task(self, exception: TaskDeferred, session: Session | None = 
None):
         """Defer task."""
-        updated_ti = _defer_task(ti=self, exception=exception, session=session)
+        updated_ti = _defer_task(ti=self, session=session, exception=exception)

Review Comment:
   Updated. Thanks!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to