jason810496 commented on code in PR #44121:
URL: https://github.com/apache/airflow/pull/44121#discussion_r1846509074


##########
airflow/api_fastapi/core_api/datamodels/pools.py:
##########
@@ -72,6 +72,25 @@ class PoolPatchBody(BaseModel):
 class PoolPostBody(BasePool):
     """Pool serializer for post bodies."""
 
-    pool: str = Field(alias="name")
+    pool: str = Field(alias="name", max_length=256)
     description: str | None = None
     include_deferred: bool = False
+
+
+class PoolPostBulkBody(BaseModel):
+    """Pools serializer for post bodies."""
+
+    pools: list[PoolPostBody]

Review Comment:
   Hi @rozza,  
   
   While refactoring `pools` with `set`, I recalled why I initially chose not 
to use `set` instead of `list` with `field_validator`. Our primary goal is to 
ensure that `PoolPostBody.name` is unique within the list. However, using a 
`set` on whole  `PoolPostBody` leads to unhashable type issues in Pydantic.  
   
   ```
   E   TypeError: unhashable type: 'PoolPostBody'
   ```
   



-- 
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]

Reply via email to