Skip to content

Commit

Permalink
Apply new Black formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
sethmlarson committed Sep 10, 2020
1 parent 7e9bd00 commit 2087f46
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 14 deletions.
5 changes: 4 additions & 1 deletion elasticsearch_dsl/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,10 @@ def updateByQuery(self, using=None):
For more information, see here:
https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update-by-query.html
"""
return UpdateByQuery(using=using or self._using, index=self._name,)
return UpdateByQuery(
using=using or self._using,
index=self._name,
)

def create(self, using=None, **kwargs):
"""
Expand Down
7 changes: 6 additions & 1 deletion elasticsearch_dsl/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,12 @@
SKIP_VALUES = ("", None)
EXPAND__TO_DOT = True

DOC_META_FIELDS = frozenset(("id", "routing",))
DOC_META_FIELDS = frozenset(
(
"id",
"routing",
)
)

META_FIELDS = frozenset(
(
Expand Down
5 changes: 4 additions & 1 deletion test_elasticsearch_dsl/test_integration/test_document.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,10 @@ def test_delete(write_client):
test_repo.meta.index = "test-document"
test_repo.delete()

assert not write_client.exists(index="test-document", id="elasticsearch-dsl-py",)
assert not write_client.exists(
index="test-document",
id="elasticsearch-dsl-py",
)


def test_search(data_client):
Expand Down
19 changes: 8 additions & 11 deletions test_elasticsearch_dsl/test_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,17 +429,14 @@ def test_source():


def test_source_on_clone():
assert (
{
"_source": {"includes": ["foo.bar.*"], "excludes": ["foo.one"]},
"query": {"bool": {"filter": [{"term": {"title": "python"}}]}},
}
== search.Search()
.source(includes=["foo.bar.*"])
.source(excludes=["foo.one"])
.filter("term", title="python")
.to_dict()
)
assert {
"_source": {"includes": ["foo.bar.*"], "excludes": ["foo.one"]},
"query": {"bool": {"filter": [{"term": {"title": "python"}}]}},
} == search.Search().source(includes=["foo.bar.*"]).source(
excludes=["foo.one"]
).filter(
"term", title="python"
).to_dict()
assert {
"_source": False,
"query": {"bool": {"filter": [{"term": {"title": "python"}}]}},
Expand Down

0 comments on commit 2087f46

Please sign in to comment.