ahilashsasidharan commented on code in PR #63994:
URL: https://github.com/apache/airflow/pull/63994#discussion_r3042558917
##########
airflow-core/src/airflow/api_fastapi/core_api/routes/public/pools.py:
##########
@@ -180,4 +197,22 @@ def bulk_pools(
session: SessionDep,
) -> BulkResponse:
"""Bulk create, update, and delete pools."""
+ if not conf.getboolean("core", "multi_team"):
+ invalid_entities = []
+
+ for action in request.actions:
+ if action.action == BulkAction.CREATE or action.action ==
BulkAction.UPDATE:
+ for entity in action.entities:
+ if isinstance(entity, PoolBody) and entity.team_name is
not None:
+ invalid_entities.append(entity.pool)
+
+ if invalid_entities:
+ raise HTTPException(
+ status.HTTP_400_BAD_REQUEST,
+ {
+ "message": MULTI_TEAM_ERROR_MESSAGE,
+ "invalid_pool_names": invalid_entities,
+ },
+ )
Review Comment:
Done
##########
airflow-core/src/airflow/api_fastapi/core_api/routes/public/connections.py:
##########
@@ -171,6 +182,24 @@ def bulk_connections(
session: SessionDep,
) -> BulkResponse:
"""Bulk create, update, and delete connections."""
+ if not conf.getboolean("core", "multi_team"):
+ invalid_entities = []
+
+ for action in request.actions:
+ if action.action == BulkAction.CREATE or action.action ==
BulkAction.UPDATE:
+ for entity in action.entities:
+ if isinstance(entity, ConnectionBody) and entity.team_name
is not None:
+ invalid_entities.append(entity.connection_id)
+
+ if invalid_entities:
+ raise HTTPException(
+ status.HTTP_400_BAD_REQUEST,
+ {
+ "message": MULTI_TEAM_ERROR_MESSAGE,
+ "invalid_connection_ids": invalid_entities,
+ },
+ )
+
return BulkConnectionService(session=session,
request=request).handle_request()
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]