amoghrajesh commented on code in PR #66586:
URL: https://github.com/apache/airflow/pull/66586#discussion_r3217816899


##########
airflow-core/src/airflow/api_fastapi/execution_api/routes/task_instances.py:
##########
@@ -460,6 +463,26 @@ def ti_update_state(
             status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, 
detail="Database error occurred"
         )
 
+    if updated_state == TaskInstanceState.SUCCESS:
+        if conf.getboolean("state_store", "clear_on_success"):
+            scope = TaskScope(dag_id=dag_id, run_id=run_id, task_id=task_id, 
map_index=map_index or -1)

Review Comment:
   Good catch! Fixed the conditional and made it `map_index if map_index is not 
None else -1`



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