pierrejeambrun commented on code in PR #67095:
URL: https://github.com/apache/airflow/pull/67095#discussion_r3275471361
##########
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:
Done
--
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]