Skip to content

Commit

Permalink
review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelgrinberg committed Sep 3, 2024
1 parent 4edf33b commit dbe03be
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions elasticsearch_dsl/search_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -717,6 +717,10 @@ def ensure_strings(
if isinstance(fields, dict):
return {k: ensure_strings(v) for k, v in fields.items()}
elif not isinstance(fields, (str, InstrumentedField)):
# we assume that if `fields` is not a any of [dict, str,
# InstrumentedField] then it is an iterable of strings or
# InstrumentedFields, so we convert them to a plain list of
# strings
return [str(f) for f in fields]
else:
return str(fields)
Expand Down

0 comments on commit dbe03be

Please sign in to comment.