KlarenceNicolasCatalan commented on code in PR #56351:
URL: https://github.com/apache/airflow/pull/56351#discussion_r2437703342


##########
airflow-core/src/airflow/api_fastapi/core_api/routes/public/task_instances.py:
##########
@@ -773,13 +775,26 @@ def post_clear_task_instances(
             end_date=body.end_date,
         )
 
+    params = inspect.signature(clear_task_instances).parameters
+    kwargs = {
+        "run_on_latest_version": body.run_on_latest_version,
+    }
+
+    # Only include this argument if the function supports it
+    if "prevent_running_task" in params:
+        kwargs["prevent_running_task"] = body.prevent_running_task

Review Comment:
   There were multiple assertion errors that faults the passing of 
`prevent_running_task` in `clear_task_instances`. Even when in the method  
`clear_task_instances` in taskinstance.py was made optional or `None` in its 
parameters, I still get the same assertion error from the tests. I think it was 
caused by having passed/ written the `prevent_running_task` variable when the 
`clear_task_instances` method was called, and so the test sees that I've passed 
5 arguments instead of 4. So, I made it check the params.



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