ashb commented on code in PR #67947:
URL: https://github.com/apache/airflow/pull/67947#discussion_r3558528032


##########
airflow-ctl/src/airflowctl/api/operations.py:
##########
@@ -733,10 +737,19 @@ def delete(self, pool: str) -> str | ServerResponseError:
 
     def update(self, pool_body: PoolPatchBody) -> PoolResponse | 
ServerResponseError:
         """Update a pool."""
-        try:
-            self.response = self.client.patch(
-                f"pools/{pool_body.pool}", 
json=pool_body.model_dump(mode="json")
-            )
+        # Workaround: the server's PATCH handler validates the partial body
+        # against ``BasePool`` (see airflow-core/.../services/public/pools.py)
+        # which requires ``include_deferred``. Omitting it fails with
+        # "Field required", sending ``null`` fails with "bool_type". When the
+        # user did not specify ``include_deferred``, fetch the pool's current
+        # value so we satisfy the validator without silently flipping the
+        # existing setting.
+        body = pool_body.model_dump(mode="json", exclude_none=True)
+        if "include_deferred" not in body:
+            current = 
PoolResponse.model_validate_json(self.client.get(f"pools/{pool_body.pool}").content)
+            body["include_deferred"] = current.include_deferred
+        try:
+            self.response = self.client.patch(f"pools/{pool_body.pool}", 
json=body)

Review Comment:
   This is 1000% unrelated to "add task instance commands" and show not be in 
this PR. 



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