pierrejeambrun commented on code in PR #45349:
URL: https://github.com/apache/airflow/pull/45349#discussion_r1922131854


##########
airflow/api_fastapi/core_api/datamodels/task_instances.py:
##########
@@ -168,7 +168,7 @@ class ClearTaskInstancesBody(BaseModel):
     only_failed: bool = True
     only_running: bool = False
     reset_dag_runs: bool = True
-    task_ids: list[str] | None = None
+    task_ids: list[str | list[str]] | None = None

Review Comment:
   This will not work for clearing multiple map index. We are currently 
receiving a 500 internal error.
   
   We can keep it like this, but we need better typing, something like:
   `tuple[str, Unpack[tuple[int, ...]]]` but we need to verify that the openapi 
/ doc is correct and that the front-end generated code looks good. And then 
before calling the `dag.clear` method, explode the call to `("task_id", 0), 
("task_id", 1)`.
   
   As a fallback, we can limit the input and let the client explode the call to 
the backend:
   Tuple of   `task_ids: list[str | tuple[str, int]] | None = None` so the user 
can pass `[["task_id", 0], ["task_id", 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