uranusjr commented on code in PR #66854:
URL: https://github.com/apache/airflow/pull/66854#discussion_r3457374232


##########
airflow-core/src/airflow/api_fastapi/execution_api/routes/task_instances.py:
##########
@@ -634,13 +673,7 @@ def _create_ti_state_update_query_and_update_state(
                 retry_reason=(ti_patch_payload.retry_reason[:500] if 
ti_patch_payload.retry_reason else None),
             )
         elif isinstance(ti_patch_payload, TISuccessStatePayload):
-            if ti is not None:
-                TI.register_asset_changes_in_db(
-                    ti,
-                    ti_patch_payload.task_outlets,
-                    ti_patch_payload.outlet_events,
-                    session=session,
-                )
+            pass  # Asset registration happens after the TI state is 
committed; see ti_update_state.

Review Comment:
   I don’t think the comment is needed. Anyone reading this part of the code 
would not assume asset registration should be done here; it was done here, but 
there’s no reason it should be.
   
   (Honestly, it is unclear why a lot of the logic, such as creating triggers 
for TIDeferredStatePayload, should be done here in the first place. Maybe it 
should be moved out too. But this is a topic for another PR.)



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