vatsrahul1001 commented on code in PR #45349:
URL: https://github.com/apache/airflow/pull/45349#discussion_r1923401405
##########
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:
Implemented fallback approach, also verified when ` ["add_one" , 0, 1]` is
passed we are now getting 422 instead of 500
##########
tests/api_fastapi/core_api/routes/public/test_task_instances.py:
##########
@@ -1839,6 +1839,31 @@ class
TestPostClearTaskInstances(TestTaskInstanceEndpoint):
2,
id="dry_run default",
),
+ pytest.param(
+ "example_python_operator",
+ [
+ {"logical_date": DEFAULT_DATETIME_1, "state":
State.FAILED},
+ {
+ "logical_date": DEFAULT_DATETIME_1 +
dt.timedelta(days=1),
+ "state": State.FAILED,
+ },
+ {
+ "logical_date": DEFAULT_DATETIME_1 +
dt.timedelta(days=2),
+ "state": State.FAILED,
+ },
+ {
+ "logical_date": DEFAULT_DATETIME_1 +
dt.timedelta(days=3),
+ "state": State.FAILED,
+ },
+ ],
+ "example_python_operator",
+ {
+ "dry_run": False,
+ "task_ids": [["print_the_context", "0"], "sleep_for_1"],
Review Comment:
fixed
--
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]