choo121600 commented on code in PR #67095:
URL: https://github.com/apache/airflow/pull/67095#discussion_r3274644683
##########
airflow-core/src/airflow/api_fastapi/core_api/services/public/dag_run.py:
##########
@@ -86,3 +101,89 @@ async def wait(self) -> AsyncGenerator[str, None]:
await asyncio.sleep(self.interval)
yield await self._serialize_response(dag_run := await
self._get_dag_run())
yield "\n"
+
+
+class BulkDagRunService(BulkService[BulkDAGRunBody]):
+ """Service for handling bulk operations on Dag Runs."""
+
+ def __init__(
+ self,
+ session: Session,
+ request: BulkBody[BulkDAGRunBody],
+ dag_id: str,
+ ):
+ super().__init__(session, request)
+ self.dag_id = dag_id
+
+ def handle_bulk_create(
+ self, action: BulkCreateAction[BulkDAGRunBody], results:
BulkActionResponse
+ ) -> None:
+ results.errors.append(
+ {
+ "error": "Dag Runs bulk create is not supported. Use the
trigger Dag Run endpoint instead.",
+ "status_code": status.HTTP_405_METHOD_NOT_ALLOWED,
+ }
+ )
+
+ def handle_bulk_update(
+ self, action: BulkUpdateAction[BulkDAGRunBody], results:
BulkActionResponse
+ ) -> None:
+ results.errors.append(
+ {
+ "error": "Dag Runs bulk update is not supported yet. Use the
patch Dag Run endpoint per run instead.",
+ "status_code": status.HTTP_405_METHOD_NOT_ALLOWED,
+ }
+ )
+
+ def handle_bulk_delete(
Review Comment:
The PR description says RUNNING should return 409 to match the single-run
DELETE behavior, but handle_bulk_delete currently skips the state check, and
the test confirms that RUNNING DagRuns are deletable.
https://github.com/apache/airflow/pull/67095/changes#diff-912842095111a7bb5d514acbfdc51d19ecad7ea2b6a6e3882f01c20fa87062adR2599-R2600
Is skipping the state check the intended behavior?
--
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]