Skip to content

Commit ac1890a

Browse files
Run pre-commit run -a black
1 parent 6adb180 commit ac1890a

File tree

13 files changed

+34
-65
lines changed

13 files changed

+34
-65
lines changed

distributed/cli/dask_worker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ def main( # type: ignore[no-untyped-def]
338338

339339
if contact_address:
340340
# we only need this to verify it is getting parsed
341-
(_, _) = get_address_host_port(contact_address, strict=True)
341+
_, _ = get_address_host_port(contact_address, strict=True)
342342
else:
343343
# if contact address is not present we use the listen_address for contact
344344
contact_address = listen_address

distributed/comm/ucx.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,12 @@
1010

1111

1212
def _raise_deprecated():
13-
message = textwrap.dedent(
14-
"""\
13+
message = textwrap.dedent("""\
1514
The 'ucx' protocol was removed from Distributed because UCX-Py has been deprecated.
1615
To continue using protocol='ucx', please install 'distributed-ucxx' (conda-forge)
1716
or 'distributed-ucxx-cu[12,13]' (PyPI, selecting 12 for CUDA version 12.*, and 13
1817
for CUDA version 13.*).
19-
"""
20-
)
18+
""")
2119
warnings.warn(message, FutureWarning)
2220
raise FutureWarning(message)
2321

distributed/nanny.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@ def close_gracefully(self, reason: str = "nanny-close-gracefully") -> None:
594594
"Closing Nanny gracefully at %r. Reason: %s", self.address_safe, reason
595595
)
596596

597-
async def close( # type:ignore[override]
597+
async def close( # type: ignore[override]
598598
self, timeout: float = 5, reason: str = "nanny-close"
599599
) -> Literal["OK"]:
600600
"""

distributed/protocol/tests/test_cupy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def test_serialize_cupy_from_rmm(size):
5757
x_np = np.arange(size, dtype="u1")
5858

5959
x_np_desc = x_np.__array_interface__
60-
(x_np_ptr, _) = x_np_desc["data"]
60+
x_np_ptr, _ = x_np_desc["data"]
6161
(x_np_size,) = x_np_desc["shape"]
6262
x = rmm.DeviceBuffer(ptr=x_np_ptr, size=x_np_size)
6363

distributed/protocol/tests/test_numba.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def test_serialize_numba_from_rmm(size):
4747
x_np = np.arange(size, dtype="u1")
4848

4949
x_np_desc = x_np.__array_interface__
50-
(x_np_ptr, _) = x_np_desc["data"]
50+
x_np_ptr, _ = x_np_desc["data"]
5151
(x_np_size,) = x_np_desc["shape"]
5252
x = rmm.DeviceBuffer(ptr=x_np_ptr, size=x_np_size)
5353

distributed/scheduler.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5045,17 +5045,15 @@ def _generate_taskstates(
50455045
"releasing all the data before resubmitting another "
50465046
"computation. More details and help can be found at "
50475047
"https://github.com/dask/dask/issues/9888. "
5048-
+ textwrap.dedent(
5049-
f"""
5048+
+ textwrap.dedent(f"""
50505049
Debugging information
50515050
---------------------
50525051
old task state: {ts.state}
50535052
old run_spec: {ts.run_spec!r}
50545053
new run_spec: {dsk[k]!r}
50555054
old dependencies: {deps_lhs}
50565055
new dependencies: {deps_rhs}
5057-
"""
5058-
)
5056+
""")
50595057
)
50605058
else:
50615059
logger.debug(

distributed/shuffle/tests/test_rechunk.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ async def test_rechunk_expand2(c, s, *ws):
384384
--------
385385
dask.array.tests.test_rechunk.test_rechunk_expand2
386386
"""
387-
(a, b) = (3, 2)
387+
a, b = (3, 2)
388388
orig = np.random.default_rng().uniform(0, 1, a**b).reshape((a,) * b)
389389
for off, off2 in product(range(1, a - 1), range(1, a - 1)):
390390
old = ((a - off, off),) * b

distributed/tests/test_config.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -200,14 +200,12 @@ def test_logging_extended():
200200

201201

202202
def test_default_logging_does_not_override_basic_config():
203-
code = textwrap.dedent(
204-
"""\
203+
code = textwrap.dedent("""\
205204
import logging
206205
logging.basicConfig()
207206
import distributed
208207
logging.getLogger("distributed").warning("hello")
209-
"""
210-
)
208+
""")
211209
proc = subprocess.run(
212210
[sys.executable, "-c", code], check=True, capture_output=True, encoding="utf8"
213211
)
@@ -216,15 +214,13 @@ def test_default_logging_does_not_override_basic_config():
216214

217215

218216
def test_basic_config_does_not_override_default_logging():
219-
code = textwrap.dedent(
220-
"""\
217+
code = textwrap.dedent("""\
221218
import logging
222219
import distributed
223220
224221
logging.basicConfig()
225222
logging.getLogger("distributed").warning("hello")
226-
"""
227-
)
223+
""")
228224
proc = subprocess.run(
229225
[sys.executable, "-c", code], check=True, capture_output=True, encoding="utf8"
230226
)

distributed/tests/test_diskutils.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,7 @@ def test_workspace_process_crash(tmp_path):
122122
sys.stdout.flush()
123123
124124
time.sleep(100)
125-
""" % dict(
126-
base_dir=base_dir
127-
)
125+
""" % dict(base_dir=base_dir)
128126

129127
p = subprocess.Popen(
130128
[sys.executable, "-c", code],

distributed/tests/test_preload.py

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -228,12 +228,10 @@ async def test_scheduler_startup_nanny(s):
228228
@gen_test()
229229
async def test_web_preload_worker():
230230
port = open_port()
231-
data = dedent(
232-
f"""\
231+
data = dedent(f"""\
233232
import dask
234233
dask.config.set(scheduler_address="tcp://127.0.0.1:{port}")
235-
"""
236-
).encode()
234+
""").encode()
237235
with mock.patch(
238236
"urllib3.PoolManager.request",
239237
**{"return_value.data": data},
@@ -252,33 +250,29 @@ async def test_web_preload_worker():
252250
)
253251
@gen_cluster(nthreads=[])
254252
async def test_client_preload_text(s):
255-
text = dedent(
256-
"""\
253+
text = dedent("""\
257254
def dask_setup(client):
258255
client.foo = "setup"
259256
260257
261258
def dask_teardown(client):
262259
client.foo = "teardown"
263-
"""
264-
)
260+
""")
265261
async with Client(address=s.address, asynchronous=True, preload=text) as c:
266262
assert c.foo == "setup"
267263
assert c.foo == "teardown"
268264

269265

270266
@gen_cluster(nthreads=[])
271267
async def test_client_preload_config(s):
272-
text = dedent(
273-
"""\
268+
text = dedent("""\
274269
def dask_setup(client):
275270
client.foo = "setup"
276271
277272
278273
def dask_teardown(client):
279274
client.foo = "teardown"
280-
"""
281-
)
275+
""")
282276
with dask.config.set({"distributed.client.preload": [text]}):
283277
async with Client(address=s.address, asynchronous=True) as c:
284278
assert c.foo == "setup"
@@ -291,16 +285,14 @@ def dask_teardown(client):
291285
)
292286
@gen_cluster(nthreads=[])
293287
async def test_client_preload_click(s):
294-
text = dedent(
295-
"""\
288+
text = dedent("""\
296289
import click
297290
298291
@click.command()
299292
@click.argument("value")
300293
def dask_setup(client, value):
301294
client.foo = value
302-
"""
303-
)
295+
""")
304296
value = "setup"
305297
async with Client(
306298
address=s.address, asynchronous=True, preload=text, preload_argv=[[value]]
@@ -387,16 +379,14 @@ def dask_teardown(worker):
387379

388380
@gen_cluster(nthreads=[])
389381
async def test_client_preload_config_click(s):
390-
text = dedent(
391-
"""\
382+
text = dedent("""\
392383
import click
393384
394385
@click.command()
395386
@click.argument("value")
396387
def dask_setup(client, value):
397388
client.foo = value
398-
"""
399-
)
389+
""")
400390
value = "setup"
401391
with dask.config.set(
402392
{

0 commit comments

Comments
 (0)