Skip to content

Switch to Black 2025 and isort 6 #2779

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions elasticsearch/dsl/search_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -698,12 +698,12 @@ def ensure_strings(fields: "InstrumentedField") -> str: ...

@overload
def ensure_strings(
fields: List[Union[str, "InstrumentedField"]]
fields: List[Union[str, "InstrumentedField"]],
) -> List[str]: ...

@overload
def ensure_strings(
fields: Dict[str, List[Union[str, "InstrumentedField"]]]
fields: Dict[str, List[Union[str, "InstrumentedField"]]],
) -> Dict[str, List[str]]: ...

def ensure_strings(
Expand All @@ -712,7 +712,7 @@ def ensure_strings(
"InstrumentedField",
List[Union[str, "InstrumentedField"]],
Dict[str, List[Union[str, "InstrumentedField"]]],
]
],
) -> Union[str, List[str], Dict[str, List[str]]]:
if isinstance(fields, dict):
return {k: ensure_strings(v) for k, v in fields.items()}
Expand Down
8 changes: 5 additions & 3 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ def test_otel(session):

@nox.session()
def format(session):
session.install(".", "black~=24.0", "isort", "flynt", "unasync>=0.6.0", "jinja2")
session.install(
".", "black~=25.0", "isort~=6.0", "flynt", "unasync>=0.6.0", "jinja2"
)

session.run("python", "utils/run-unasync.py")
session.run("python", "utils/run-unasync-dsl.py")
Expand All @@ -88,9 +90,9 @@ def lint(session):

session.install(
"flake8",
"black~=24.0",
"black~=25.0",
"mypy",
"isort",
"isort~=6.0",
"types-requests",
"types-python-dateutil",
"unasync>=0.6.0",
Expand Down
4 changes: 2 additions & 2 deletions test_elasticsearch/test_dsl/test_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def test_iterating_over_response_gives_you_hits(dummy_response: Dict[str, Any])


def test_hits_get_wrapped_to_contain_additional_attrs(
dummy_response: Dict[str, Any]
dummy_response: Dict[str, Any],
) -> None:
res = response.Response(Search(), dummy_response)
hits = res.hits
Expand All @@ -140,7 +140,7 @@ def test_hits_get_wrapped_to_contain_additional_attrs(


def test_hits_provide_dot_and_bracket_access_to_attrs(
dummy_response: Dict[str, Any]
dummy_response: Dict[str, Any],
) -> None:
res = response.Response(Search(), dummy_response)
h = res.hits[0]
Expand Down
Loading