Skip to content

Commit 53844b4

Browse files
committed
Revert "Fix: Keyword arguments to submit get caught (#1407)"
This reverts commit 6cc8bb1.
1 parent d29ba7a commit 53844b4

File tree

3 files changed

+10
-49
lines changed

3 files changed

+10
-49
lines changed

autosklearn/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
"""Version information."""
22

33
# The following line *must* be the last in the module, exactly as formatted:
4-
__version__ = "0.14.6"
4+
__version__ = "0.14.4"
Lines changed: 9 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import typing
22
from pathlib import Path
3-
from typing import Any
43

54
import dask.distributed
65

@@ -10,7 +9,6 @@ class DummyFuture(dask.distributed.Future):
109
A class that mimics a distributed Future, the outcome of
1110
performing submit on a distributed client.
1211
"""
13-
1412
def __init__(self, result: typing.Any) -> None:
1513
self._result = result # type: typing.Any
1614

@@ -35,24 +33,13 @@ class SingleThreadedClient(dask.distributed.Client):
3533
A class to Mock the Distributed Client class, in case
3634
Auto-Sklearn is meant to run in the current Thread.
3735
"""
38-
3936
def __init__(self) -> None:
4037

4138
# Raise a not implemented error if using a method from Client
42-
implemented_methods = [
43-
"submit",
44-
"close",
45-
"shutdown",
46-
"write_scheduler_file",
47-
"_get_scheduler_info",
48-
"nthreads",
49-
]
50-
method_list = [
51-
func
52-
for func in dir(dask.distributed.Client)
53-
if callable(getattr(dask.distributed.Client, func))
54-
and not func.startswith("__")
55-
]
39+
implemented_methods = ['submit', 'close', 'shutdown', 'write_scheduler_file',
40+
'_get_scheduler_info', 'nthreads']
41+
method_list = [func for func in dir(dask.distributed.Client) if callable(
42+
getattr(dask.distributed.Client, func)) and not func.startswith('__')]
5643
for method in method_list:
5744
if method in implemented_methods:
5845
continue
@@ -67,24 +54,8 @@ def submit(
6754
func: typing.Callable,
6855
*args: typing.List,
6956
priority: int = 0,
70-
key: Any = None,
71-
workers: Any = None,
72-
resources: Any = None,
73-
retries: Any = None,
74-
fifo_timeout: Any = "100 ms",
75-
allow_other_workers: Any = False,
76-
actor: Any = False,
77-
actors: Any = False,
78-
pure: Any = None,
79-
**kwargs: Any,
57+
**kwargs: typing.Dict,
8058
) -> typing.Any:
81-
"""
82-
Note
83-
----
84-
The keyword arguments caught in `dask.distributed.Client` need to
85-
be specified here so they don't get passed in as ``**kwargs`` to the
86-
``func``.
87-
"""
8859
return DummyFuture(func(*args, **kwargs))
8960

9061
def close(self) -> None:
@@ -99,17 +70,17 @@ def write_scheduler_file(self, scheduler_file: str) -> None:
9970

10071
def _get_scheduler_info(self) -> typing.Dict:
10172
return {
102-
"workers": ["127.0.0.1"],
103-
"type": "Scheduler",
73+
'workers': ['127.0.0.1'],
74+
'type': 'Scheduler',
10475
}
10576

10677
def nthreads(self) -> typing.Dict:
10778
return {
108-
"127.0.0.1": 1,
79+
'127.0.0.1': 1,
10980
}
11081

11182
def __repr__(self) -> str:
112-
return "SingleThreadedClient()"
83+
return 'SingleThreadedClient()'
11384

11485
def __del__(self) -> None:
11586
pass

doc/releases.rst

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,6 @@
99
Releases
1010
========
1111

12-
Version 0.14.6
13-
==============
14-
15-
* HOTFIX #1407: Catches keyword arguments in `SingleThreadedClient` so they don't get passed to it's executing `func`.
16-
17-
Contributors v0.14.6
18-
********************
19-
* Eddie Bergman
20-
21-
2212
Version 0.14.5
2313
==============
2414

0 commit comments

Comments
 (0)