Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added parentheses (#19853) #19854

Merged
merged 1 commit into from
Nov 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion airflow/_vendor/connexion/apis/flask_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def _build_response(cls, mimetype, content_type=None, headers=None, status_code=
def _serialize_data(cls, data, mimetype):
# TODO: harmonize flask and aiohttp serialization when mimetype=None or mimetype is not JSON
# (cases where it might not make sense to jsonify the data)
if (isinstance(mimetype, str) and is_json_mimetype(mimetype)):
if isinstance(mimetype, str) and is_json_mimetype(mimetype):
body = cls.jsonifier.dumps(data)
elif not (isinstance(data, bytes) or isinstance(data, str)):
warnings.warn(
Expand Down
6 changes: 3 additions & 3 deletions airflow/_vendor/connexion/decorators/uri_parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def resolve_params(self, params, _in):
# multiple values in a path is impossible
values = [values]

if (param_schema is not None and param_schema['type'] == 'array'):
if param_schema is not None and param_schema['type'] == 'array':
# resolve variable re-assignment, handle explode
values = self._resolve_param_duplicates(values, param_defn, _in)
# handle array styles
Expand Down Expand Up @@ -186,15 +186,15 @@ def _make_deep_object(k, v):
"""
root_key = k.split("[", 1)[0]
if k == root_key:
return (k, v, False)
return k, v, False
key_path = re.findall(r'\[([^\[\]]*)\]', k)
root = prev = node = {}
for k in key_path:
node[k] = {}
prev = node
node = node[k]
prev[k] = v[0]
return (root_key, [root], True)
return root_key, [root], True

def _preprocess_deep_objects(self, query_data):
""" deep objects provide a way of rendering nested objects using query
Expand Down
2 changes: 1 addition & 1 deletion airflow/_vendor/connexion/operations/openapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ def example_response(self, status_code=None, content_type=None):
return (self._nested_example(deep_get(self._responses, schema_path)),
status_code)
except KeyError:
return (None, status_code)
return None, status_code

def _nested_example(self, schema):
try:
Expand Down
2 changes: 1 addition & 1 deletion airflow/_vendor/connexion/operations/swagger2.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def example_response(self, status_code=None, *args, **kwargs):
return (self._nested_example(deep_get(self._responses, schema_path)),
status_code)
except KeyError:
return (None, status_code)
return None, status_code

def _nested_example(self, schema):
try:
Expand Down