Skip to content

Commit 7874040

Browse files
committed
Fix linting issues from new Black formatter
1 parent dac1a1b commit 7874040

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

elasticsearch_dsl/faceted_search.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ class TermsFacet(Facet):
117117
agg_type = "terms"
118118

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

170170

171171
def _date_interval_year(d):
172-
return d.replace(year=d.year+1, day=(28 if d.month == 2 and d.day == 29 else d.day))
172+
return d.replace(
173+
year=d.year + 1, day=(28 if d.month == 2 and d.day == 29 else d.day)
174+
)
173175

174176

175177
def _date_interval_month(d):

elasticsearch_dsl/mapping.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def field(self, name, *args, **kwargs):
6565
return self
6666

6767
def _collect_fields(self):
68-
""" Iterate over all Field objects within, including multi fields. """
68+
"""Iterate over all Field objects within, including multi fields."""
6969
for f in itervalues(self.properties.to_dict()):
7070
yield f
7171
# multi fields

elasticsearch_dsl/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ def __init__(self, _expand__to_dot=EXPAND__TO_DOT, **params):
273273
self._setattr(pname, pvalue)
274274

275275
def _repr_params(self):
276-
""" Produce a repr of all our parameters to be used in __repr__. """
276+
"""Produce a repr of all our parameters to be used in __repr__."""
277277
return ", ".join(
278278
"{}={!r}".format(n.replace(".", "__"), v)
279279
for (n, v) in sorted(iteritems(self._params))

examples/parent_child.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ class Question(Post):
123123

124124
@classmethod
125125
def _matches(cls, hit):
126-
""" Use Question class for parent documents """
126+
"""Use Question class for parent documents"""
127127
return hit["_source"]["question_answer"] == "question"
128128

129129
@classmethod
@@ -176,7 +176,7 @@ class Answer(Post):
176176

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

204204

205205
def setup():
206-
""" Create an IndexTemplate and save it into elasticsearch. """
206+
"""Create an IndexTemplate and save it into elasticsearch."""
207207
index_template = Post._index.as_template("base")
208208
index_template.save()
209209

0 commit comments

Comments
 (0)