Skip to content

Commit 4a7dd93

Browse files
committed
Switch to Black 2025 code style
1 parent b875a0b commit 4a7dd93

File tree

9 files changed

+13
-52
lines changed

9 files changed

+13
-52
lines changed

elasticsearch/dsl/_sync/search.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,7 @@
1616
# under the License.
1717

1818
import contextlib
19-
from typing import (
20-
TYPE_CHECKING,
21-
Any,
22-
Dict,
23-
Iterator,
24-
List,
25-
Optional,
26-
cast,
27-
)
19+
from typing import TYPE_CHECKING, Any, Dict, Iterator, List, Optional, cast
2820

2921
from typing_extensions import Self
3022

elasticsearch/dsl/search_base.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -698,12 +698,12 @@ def ensure_strings(fields: "InstrumentedField") -> str: ...
698698

699699
@overload
700700
def ensure_strings(
701-
fields: List[Union[str, "InstrumentedField"]]
701+
fields: List[Union[str, "InstrumentedField"]],
702702
) -> List[str]: ...
703703

704704
@overload
705705
def ensure_strings(
706-
fields: Dict[str, List[Union[str, "InstrumentedField"]]]
706+
fields: Dict[str, List[Union[str, "InstrumentedField"]]],
707707
) -> Dict[str, List[str]]: ...
708708

709709
def ensure_strings(
@@ -712,7 +712,7 @@ def ensure_strings(
712712
"InstrumentedField",
713713
List[Union[str, "InstrumentedField"]],
714714
Dict[str, List[Union[str, "InstrumentedField"]]],
715-
]
715+
],
716716
) -> Union[str, List[str], Dict[str, List[str]]]:
717717
if isinstance(fields, dict):
718718
return {k: ensure_strings(v) for k, v in fields.items()}

elasticsearch/helpers/vectorstore/_sync/vectorstore.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,7 @@
2222
from elasticsearch import Elasticsearch
2323
from elasticsearch._version import __versionstr__ as lib_version
2424
from elasticsearch.helpers import BulkIndexError, bulk
25-
from elasticsearch.helpers.vectorstore import (
26-
EmbeddingService,
27-
RetrievalStrategy,
28-
)
25+
from elasticsearch.helpers.vectorstore import EmbeddingService, RetrievalStrategy
2926
from elasticsearch.helpers.vectorstore._utils import maximal_marginal_relevance
3027

3128
logger = logging.getLogger(__name__)

examples/dsl/search_as_you_type.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,7 @@
2828
import os
2929
from typing import TYPE_CHECKING, Optional
3030

31-
from elasticsearch.dsl import (
32-
Document,
33-
SearchAsYouType,
34-
connections,
35-
mapped_field,
36-
)
31+
from elasticsearch.dsl import Document, SearchAsYouType, connections, mapped_field
3732
from elasticsearch.dsl.query import MultiMatch
3833

3934

noxfile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def test_otel(session):
6666

6767
@nox.session()
6868
def format(session):
69-
session.install(".", "black~=24.0", "isort", "flynt", "unasync>=0.6.0", "jinja2")
69+
session.install(".", "black~=25.0", "isort", "flynt", "unasync>=0.6.0", "jinja2")
7070

7171
session.run("python", "utils/run-unasync.py")
7272
session.run("python", "utils/run-unasync-dsl.py")
@@ -88,7 +88,7 @@ def lint(session):
8888

8989
session.install(
9090
"flake8",
91-
"black~=24.0",
91+
"black~=25.0",
9292
"mypy",
9393
"isort",
9494
"types-requests",

test_elasticsearch/test_dsl/_sync/test_index.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,7 @@
2222
import pytest
2323
from pytest import raises
2424

25-
from elasticsearch.dsl import (
26-
Date,
27-
Document,
28-
Index,
29-
IndexTemplate,
30-
Text,
31-
analyzer,
32-
)
25+
from elasticsearch.dsl import Date, Document, Index, IndexTemplate, Text, analyzer
3326

3427

3528
class Post(Document):

test_elasticsearch/test_dsl/_sync/test_search.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,7 @@
2121
import pytest
2222
from pytest import raises
2323

24-
from elasticsearch.dsl import (
25-
Document,
26-
EmptySearch,
27-
Q,
28-
Search,
29-
query,
30-
types,
31-
wrappers,
32-
)
24+
from elasticsearch.dsl import Document, EmptySearch, Q, Search, query, types, wrappers
3325
from elasticsearch.dsl.exceptions import IllegalOperation
3426

3527

test_elasticsearch/test_dsl/test_integration/_sync/test_search.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,7 @@
2020
from pytest import raises
2121

2222
from elasticsearch import ApiError, Elasticsearch
23-
from elasticsearch.dsl import (
24-
Date,
25-
Document,
26-
Keyword,
27-
MultiSearch,
28-
Q,
29-
Search,
30-
Text,
31-
)
23+
from elasticsearch.dsl import Date, Document, Keyword, MultiSearch, Q, Search, Text
3224
from elasticsearch.dsl.response import aggs
3325

3426
from ..test_data import FLAT_DATA

test_elasticsearch/test_dsl/test_result.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def test_iterating_over_response_gives_you_hits(dummy_response: Dict[str, Any])
130130

131131

132132
def test_hits_get_wrapped_to_contain_additional_attrs(
133-
dummy_response: Dict[str, Any]
133+
dummy_response: Dict[str, Any],
134134
) -> None:
135135
res = response.Response(Search(), dummy_response)
136136
hits = res.hits
@@ -140,7 +140,7 @@ def test_hits_get_wrapped_to_contain_additional_attrs(
140140

141141

142142
def test_hits_provide_dot_and_bracket_access_to_attrs(
143-
dummy_response: Dict[str, Any]
143+
dummy_response: Dict[str, Any],
144144
) -> None:
145145
res = response.Response(Search(), dummy_response)
146146
h = res.hits[0]

0 commit comments

Comments
 (0)