This is an automated email from the ASF dual-hosted git repository.
potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new ba9d4e470d Remove redundant dict.keys() call (#33158)
ba9d4e470d is described below
commit ba9d4e470de13031fc306772900c73b9642bb0cb
Author: Miroslav Šedivý <[email protected]>
AuthorDate: Mon Aug 7 18:51:39 2023 +0000
Remove redundant dict.keys() call (#33158)
---
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)}")