jscheffl commented on code in PR #44098:
URL: https://github.com/apache/airflow/pull/44098#discussion_r1845403784


##########
airflow/models/taskinstance.py:
##########
@@ -2796,20 +2796,33 @@ def _run_raw_task(
             session=session,
         )
 
-    def _register_asset_changes(self, *, events: OutletEventAccessors, 
session: Session) -> None:
+    def _register_asset_changes(
+        self, *, events: OutletEventAccessors, session: Session | None = None
+    ) -> None:
+        if session:
+            TaskInstance._register_asset_changes_int(ti=self, events=events, 
session=session)
+        else:
+            TaskInstance._register_asset_changes_int(ti=self, events=events)
+
+    @staticmethod
+    @internal_api_call
+    @provide_session
+    def _register_asset_changes_int(
+        ti: TaskInstance, *, events: OutletEventAccessors, session: Session = 
NEW_SESSION
+    ) -> None:
         if TYPE_CHECKING:
-            assert self.task
+            assert ti.task

Review Comment:
   The internal API (in AIP-44) can not call on class instances, can only use 
static methods. That's why I needed to add a wrapper and switch to `ti` instead 
of `self`.



-- 
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