ahilashsasidharan commented on code in PR #63994:
URL: https://github.com/apache/airflow/pull/63994#discussion_r3069414559
##########
airflow-core/src/airflow/api_fastapi/core_api/datamodels/pools.py:
##########
@@ -83,6 +84,12 @@ class PoolPatchBody(StrictBaseModel):
include_deferred: bool | None = None
team_name: str | None = Field(max_length=50, default=None)
+ @model_validator(mode="after")
+ def validate_team_name(self) -> PoolPatchBody:
+ if self.team_name is not None and not conf.getboolean("core",
"multi_team"):
+ raise ValueError("team_name cannot be set when multi_team mode is
disabled")
+ return self
Review Comment:
No clear place to put this code, and is only duplicated across 3 files so
not implementing this.
##########
airflow-core/src/airflow/api_fastapi/core_api/datamodels/pools.py:
##########
@@ -91,3 +98,9 @@ class PoolBody(BasePool, StrictBaseModel):
description: str | None = None
include_deferred: bool = False
team_name: str | None = Field(max_length=50, default=None)
+
+ @model_validator(mode="after")
+ def validate_team_name(self) -> PoolBody:
+ if self.team_name is not None and not conf.getboolean("core",
"multi_team"):
+ raise ValueError("team_name cannot be set when multi_team mode is
disabled")
+ return self
Review Comment:
No clear place to put this code, and is only duplicated across 3 files so
not implementing this.
--
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]