Skip to content

Commit

Permalink
Fix linting issues from new Black formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
sethmlarson committed Aug 12, 2021
1 parent dac1a1b commit 7874040
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
6 changes: 4 additions & 2 deletions elasticsearch_dsl/faceted_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class TermsFacet(Facet):
agg_type = "terms"

def add_filter(self, filter_values):
""" Create a terms filter instead of bool containing term filters. """
"""Create a terms filter instead of bool containing term filters."""
if filter_values:
return Terms(
_expand__to_dot=False, **{self._params["field"]: filter_values}
Expand Down Expand Up @@ -169,7 +169,9 @@ def get_value_filter(self, filter_value):


def _date_interval_year(d):
return d.replace(year=d.year+1, day=(28 if d.month == 2 and d.day == 29 else d.day))
return d.replace(
year=d.year + 1, day=(28 if d.month == 2 and d.day == 29 else d.day)
)


def _date_interval_month(d):
Expand Down
2 changes: 1 addition & 1 deletion elasticsearch_dsl/mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def field(self, name, *args, **kwargs):
return self

def _collect_fields(self):
""" Iterate over all Field objects within, including multi fields. """
"""Iterate over all Field objects within, including multi fields."""
for f in itervalues(self.properties.to_dict()):
yield f
# multi fields
Expand Down
2 changes: 1 addition & 1 deletion elasticsearch_dsl/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ def __init__(self, _expand__to_dot=EXPAND__TO_DOT, **params):
self._setattr(pname, pvalue)

def _repr_params(self):
""" Produce a repr of all our parameters to be used in __repr__. """
"""Produce a repr of all our parameters to be used in __repr__."""
return ", ".join(
"{}={!r}".format(n.replace(".", "__"), v)
for (n, v) in sorted(iteritems(self._params))
Expand Down
6 changes: 3 additions & 3 deletions examples/parent_child.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ class Question(Post):

@classmethod
def _matches(cls, hit):
""" Use Question class for parent documents """
"""Use Question class for parent documents"""
return hit["_source"]["question_answer"] == "question"

@classmethod
Expand Down Expand Up @@ -176,7 +176,7 @@ class Answer(Post):

@classmethod
def _matches(cls, hit):
""" Use Answer class for child documents with child name 'answer' """
"""Use Answer class for child documents with child name 'answer'"""
return (
isinstance(hit["_source"]["question_answer"], dict)
and hit["_source"]["question_answer"].get("name") == "answer"
Expand All @@ -203,7 +203,7 @@ def save(self, **kwargs):


def setup():
""" Create an IndexTemplate and save it into elasticsearch. """
"""Create an IndexTemplate and save it into elasticsearch."""
index_template = Post._index.as_template("base")
index_template.save()

Expand Down

0 comments on commit 7874040

Please sign in to comment.