This is an automated email from the ASF dual-hosted git repository.

ephraimanierobi pushed a commit to branch v2-7-test
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit cf9e3fcdddd1674025b97a3f80ee4d2dbe6b219b
Author: Miroslav Šedivý <[email protected]>
AuthorDate: Mon Aug 7 18:51:39 2023 +0000

    Remove redundant dict.keys() call (#33158)
    
    (cherry picked from commit ba9d4e470de13031fc306772900c73b9642bb0cb)
---
 airflow/api_connexion/endpoints/pool_endpoint.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/airflow/api_connexion/endpoints/pool_endpoint.py 
b/airflow/api_connexion/endpoints/pool_endpoint.py
index 3668741c1e..6503705d85 100644
--- a/airflow/api_connexion/endpoints/pool_endpoint.py
+++ b/airflow/api_connexion/endpoints/pool_endpoint.py
@@ -124,7 +124,7 @@ def patch_pool(
 
     else:
         required_fields = {"name", "slots"}
-        fields_diff = required_fields - set(get_json_request_dict().keys())
+        fields_diff = required_fields.difference(get_json_request_dict())
         if fields_diff:
             raise BadRequest(detail=f"Missing required property(ies): 
{sorted(fields_diff)}")
 
@@ -139,7 +139,7 @@ def patch_pool(
 def post_pool(*, session: Session = NEW_SESSION) -> APIResponse:
     """Create a pool."""
     required_fields = {"name", "slots"}  # Pool would require both fields in 
the post request
-    fields_diff = required_fields - set(get_json_request_dict().keys())
+    fields_diff = required_fields.difference(get_json_request_dict())
     if fields_diff:
         raise BadRequest(detail=f"Missing required property(ies): 
{sorted(fields_diff)}")
 

Reply via email to