Skip to content

[Backport 8.12] Switch to 2024 black style #2432

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 1 commit into from
Feb 8, 2024
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/_async/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,9 +392,9 @@ def __init__(
if sniff_timeout is not DEFAULT:
transport_kwargs["sniff_timeout"] = sniff_timeout
if min_delay_between_sniffing is not DEFAULT:
transport_kwargs[
"min_delay_between_sniffing"
] = min_delay_between_sniffing
transport_kwargs["min_delay_between_sniffing"] = (
min_delay_between_sniffing
)

_transport = transport_class(
node_configs,
Expand Down
6 changes: 3 additions & 3 deletions elasticsearch/_async/client/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,9 @@ def resolve_auth_headers(
if resolved_api_key:
headers["authorization"] = f"ApiKey {_base64_auth_header(resolved_api_key)}"
if resolved_basic_auth:
headers[
"authorization"
] = f"Basic {_base64_auth_header(resolved_basic_auth)}"
headers["authorization"] = (
f"Basic {_base64_auth_header(resolved_basic_auth)}"
)
if resolved_bearer_auth:
headers["authorization"] = f"Bearer {resolved_bearer_auth}"

Expand Down
60 changes: 30 additions & 30 deletions elasticsearch/_async/client/ccr.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,13 +147,13 @@ async def follow(
if max_outstanding_read_requests is not None:
__body["max_outstanding_read_requests"] = max_outstanding_read_requests
if max_outstanding_write_requests is not None:
__body[
"max_outstanding_write_requests"
] = max_outstanding_write_requests
__body["max_outstanding_write_requests"] = (
max_outstanding_write_requests
)
if max_read_request_operation_count is not None:
__body[
"max_read_request_operation_count"
] = max_read_request_operation_count
__body["max_read_request_operation_count"] = (
max_read_request_operation_count
)
if max_read_request_size is not None:
__body["max_read_request_size"] = max_read_request_size
if max_retry_delay is not None:
Expand All @@ -163,9 +163,9 @@ async def follow(
if max_write_buffer_size is not None:
__body["max_write_buffer_size"] = max_write_buffer_size
if max_write_request_operation_count is not None:
__body[
"max_write_request_operation_count"
] = max_write_request_operation_count
__body["max_write_request_operation_count"] = (
max_write_request_operation_count
)
if max_write_request_size is not None:
__body["max_write_request_size"] = max_write_request_size
if read_poll_timeout is not None:
Expand Down Expand Up @@ -537,21 +537,21 @@ async def put_auto_follow_pattern(
if follow_index_pattern is not None:
__body["follow_index_pattern"] = follow_index_pattern
if leader_index_exclusion_patterns is not None:
__body[
"leader_index_exclusion_patterns"
] = leader_index_exclusion_patterns
__body["leader_index_exclusion_patterns"] = (
leader_index_exclusion_patterns
)
if leader_index_patterns is not None:
__body["leader_index_patterns"] = leader_index_patterns
if max_outstanding_read_requests is not None:
__body["max_outstanding_read_requests"] = max_outstanding_read_requests
if max_outstanding_write_requests is not None:
__body[
"max_outstanding_write_requests"
] = max_outstanding_write_requests
__body["max_outstanding_write_requests"] = (
max_outstanding_write_requests
)
if max_read_request_operation_count is not None:
__body[
"max_read_request_operation_count"
] = max_read_request_operation_count
__body["max_read_request_operation_count"] = (
max_read_request_operation_count
)
if max_read_request_size is not None:
__body["max_read_request_size"] = max_read_request_size
if max_retry_delay is not None:
Expand All @@ -561,9 +561,9 @@ async def put_auto_follow_pattern(
if max_write_buffer_size is not None:
__body["max_write_buffer_size"] = max_write_buffer_size
if max_write_request_operation_count is not None:
__body[
"max_write_request_operation_count"
] = max_write_request_operation_count
__body["max_write_request_operation_count"] = (
max_write_request_operation_count
)
if max_write_request_size is not None:
__body["max_write_request_size"] = max_write_request_size
if read_poll_timeout is not None:
Expand Down Expand Up @@ -682,13 +682,13 @@ async def resume_follow(
if max_outstanding_read_requests is not None:
__body["max_outstanding_read_requests"] = max_outstanding_read_requests
if max_outstanding_write_requests is not None:
__body[
"max_outstanding_write_requests"
] = max_outstanding_write_requests
__body["max_outstanding_write_requests"] = (
max_outstanding_write_requests
)
if max_read_request_operation_count is not None:
__body[
"max_read_request_operation_count"
] = max_read_request_operation_count
__body["max_read_request_operation_count"] = (
max_read_request_operation_count
)
if max_read_request_size is not None:
__body["max_read_request_size"] = max_read_request_size
if max_retry_delay is not None:
Expand All @@ -698,9 +698,9 @@ async def resume_follow(
if max_write_buffer_size is not None:
__body["max_write_buffer_size"] = max_write_buffer_size
if max_write_request_operation_count is not None:
__body[
"max_write_request_operation_count"
] = max_write_request_operation_count
__body["max_write_request_operation_count"] = (
max_write_request_operation_count
)
if max_write_request_size is not None:
__body["max_write_request_size"] = max_write_request_size
if read_poll_timeout is not None:
Expand Down
12 changes: 6 additions & 6 deletions elasticsearch/_async/client/ml.py
Original file line number Diff line number Diff line change
Expand Up @@ -3189,9 +3189,9 @@ async def put_job(
if custom_settings is not None:
__body["custom_settings"] = custom_settings
if daily_model_snapshot_retention_after_days is not None:
__body[
"daily_model_snapshot_retention_after_days"
] = daily_model_snapshot_retention_after_days
__body["daily_model_snapshot_retention_after_days"] = (
daily_model_snapshot_retention_after_days
)
if datafeed_config is not None:
__body["datafeed_config"] = datafeed_config
if description is not None:
Expand Down Expand Up @@ -4420,9 +4420,9 @@ async def update_job(
if custom_settings is not None:
__body["custom_settings"] = custom_settings
if daily_model_snapshot_retention_after_days is not None:
__body[
"daily_model_snapshot_retention_after_days"
] = daily_model_snapshot_retention_after_days
__body["daily_model_snapshot_retention_after_days"] = (
daily_model_snapshot_retention_after_days
)
if description is not None:
__body["description"] = description
if detectors is not None:
Expand Down
6 changes: 3 additions & 3 deletions elasticsearch/_sync/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,9 +392,9 @@ def __init__(
if sniff_timeout is not DEFAULT:
transport_kwargs["sniff_timeout"] = sniff_timeout
if min_delay_between_sniffing is not DEFAULT:
transport_kwargs[
"min_delay_between_sniffing"
] = min_delay_between_sniffing
transport_kwargs["min_delay_between_sniffing"] = (
min_delay_between_sniffing
)

_transport = transport_class(
node_configs,
Expand Down
6 changes: 3 additions & 3 deletions elasticsearch/_sync/client/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,9 @@ def resolve_auth_headers(
if resolved_api_key:
headers["authorization"] = f"ApiKey {_base64_auth_header(resolved_api_key)}"
if resolved_basic_auth:
headers[
"authorization"
] = f"Basic {_base64_auth_header(resolved_basic_auth)}"
headers["authorization"] = (
f"Basic {_base64_auth_header(resolved_basic_auth)}"
)
if resolved_bearer_auth:
headers["authorization"] = f"Bearer {resolved_bearer_auth}"

Expand Down
60 changes: 30 additions & 30 deletions elasticsearch/_sync/client/ccr.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,13 +147,13 @@ def follow(
if max_outstanding_read_requests is not None:
__body["max_outstanding_read_requests"] = max_outstanding_read_requests
if max_outstanding_write_requests is not None:
__body[
"max_outstanding_write_requests"
] = max_outstanding_write_requests
__body["max_outstanding_write_requests"] = (
max_outstanding_write_requests
)
if max_read_request_operation_count is not None:
__body[
"max_read_request_operation_count"
] = max_read_request_operation_count
__body["max_read_request_operation_count"] = (
max_read_request_operation_count
)
if max_read_request_size is not None:
__body["max_read_request_size"] = max_read_request_size
if max_retry_delay is not None:
Expand All @@ -163,9 +163,9 @@ def follow(
if max_write_buffer_size is not None:
__body["max_write_buffer_size"] = max_write_buffer_size
if max_write_request_operation_count is not None:
__body[
"max_write_request_operation_count"
] = max_write_request_operation_count
__body["max_write_request_operation_count"] = (
max_write_request_operation_count
)
if max_write_request_size is not None:
__body["max_write_request_size"] = max_write_request_size
if read_poll_timeout is not None:
Expand Down Expand Up @@ -537,21 +537,21 @@ def put_auto_follow_pattern(
if follow_index_pattern is not None:
__body["follow_index_pattern"] = follow_index_pattern
if leader_index_exclusion_patterns is not None:
__body[
"leader_index_exclusion_patterns"
] = leader_index_exclusion_patterns
__body["leader_index_exclusion_patterns"] = (
leader_index_exclusion_patterns
)
if leader_index_patterns is not None:
__body["leader_index_patterns"] = leader_index_patterns
if max_outstanding_read_requests is not None:
__body["max_outstanding_read_requests"] = max_outstanding_read_requests
if max_outstanding_write_requests is not None:
__body[
"max_outstanding_write_requests"
] = max_outstanding_write_requests
__body["max_outstanding_write_requests"] = (
max_outstanding_write_requests
)
if max_read_request_operation_count is not None:
__body[
"max_read_request_operation_count"
] = max_read_request_operation_count
__body["max_read_request_operation_count"] = (
max_read_request_operation_count
)
if max_read_request_size is not None:
__body["max_read_request_size"] = max_read_request_size
if max_retry_delay is not None:
Expand All @@ -561,9 +561,9 @@ def put_auto_follow_pattern(
if max_write_buffer_size is not None:
__body["max_write_buffer_size"] = max_write_buffer_size
if max_write_request_operation_count is not None:
__body[
"max_write_request_operation_count"
] = max_write_request_operation_count
__body["max_write_request_operation_count"] = (
max_write_request_operation_count
)
if max_write_request_size is not None:
__body["max_write_request_size"] = max_write_request_size
if read_poll_timeout is not None:
Expand Down Expand Up @@ -682,13 +682,13 @@ def resume_follow(
if max_outstanding_read_requests is not None:
__body["max_outstanding_read_requests"] = max_outstanding_read_requests
if max_outstanding_write_requests is not None:
__body[
"max_outstanding_write_requests"
] = max_outstanding_write_requests
__body["max_outstanding_write_requests"] = (
max_outstanding_write_requests
)
if max_read_request_operation_count is not None:
__body[
"max_read_request_operation_count"
] = max_read_request_operation_count
__body["max_read_request_operation_count"] = (
max_read_request_operation_count
)
if max_read_request_size is not None:
__body["max_read_request_size"] = max_read_request_size
if max_retry_delay is not None:
Expand All @@ -698,9 +698,9 @@ def resume_follow(
if max_write_buffer_size is not None:
__body["max_write_buffer_size"] = max_write_buffer_size
if max_write_request_operation_count is not None:
__body[
"max_write_request_operation_count"
] = max_write_request_operation_count
__body["max_write_request_operation_count"] = (
max_write_request_operation_count
)
if max_write_request_size is not None:
__body["max_write_request_size"] = max_write_request_size
if read_poll_timeout is not None:
Expand Down
12 changes: 6 additions & 6 deletions elasticsearch/_sync/client/ml.py
Original file line number Diff line number Diff line change
Expand Up @@ -3189,9 +3189,9 @@ def put_job(
if custom_settings is not None:
__body["custom_settings"] = custom_settings
if daily_model_snapshot_retention_after_days is not None:
__body[
"daily_model_snapshot_retention_after_days"
] = daily_model_snapshot_retention_after_days
__body["daily_model_snapshot_retention_after_days"] = (
daily_model_snapshot_retention_after_days
)
if datafeed_config is not None:
__body["datafeed_config"] = datafeed_config
if description is not None:
Expand Down Expand Up @@ -4420,9 +4420,9 @@ def update_job(
if custom_settings is not None:
__body["custom_settings"] = custom_settings
if daily_model_snapshot_retention_after_days is not None:
__body[
"daily_model_snapshot_retention_after_days"
] = daily_model_snapshot_retention_after_days
__body["daily_model_snapshot_retention_after_days"] = (
daily_model_snapshot_retention_after_days
)
if description is not None:
__body["description"] = description
if detectors is not None:
Expand Down
4 changes: 2 additions & 2 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def test(session):

@nox.session()
def format(session):
session.install("black", "isort", "flynt", "unasync")
session.install("black~=24.0", "isort", "flynt", "unasync", "setuptools")

session.run("python", "utils/run-unasync.py")
session.run("isort", "--profile=black", *SOURCE_FILES)
Expand All @@ -66,7 +66,7 @@ def format(session):

@nox.session()
def lint(session):
session.install("flake8", "black", "mypy", "isort", "types-requests")
session.install("flake8", "black~=24.0", "mypy", "isort", "types-requests")

session.run("isort", "--check", "--profile=black", *SOURCE_FILES)
session.run("black", "--check", *SOURCE_FILES)
Expand Down