Skip to content

Commit 1458ad1

Browse files
committed
Flake8. Add thread safety to get_run.
1 parent a0a584a commit 1458ad1

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

openml/datasets/functions.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@
2323
from ..utils import (
2424
_create_cache_directory,
2525
_remove_cache_dir_for_id,
26-
_create_cache_directory_for_id,
27-
_create_lockfiles_dir,
26+
_create_cache_directory_for_id
2827
)
2928

3029

openml/runs/functions.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,7 @@ def get_runs(run_ids):
466466
return runs
467467

468468

469+
@openml.utils.thread_safe_if_oslo_installed
469470
def get_run(run_id):
470471
"""Gets run corresponding to run_id.
471472

openml/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ def _remove_cache_dir_for_id(key, cache_dir):
294294
def thread_safe_if_oslo_installed(func):
295295
if oslo_installed:
296296
def safe_func(*args, **kwargs):
297-
# Lock directories use the id that is passed as either a first argument, or as a keyword.
297+
# Lock directories use the id that is passed as either positional or keyword argument.
298298
id_parameters = [parameter_name for parameter_name in kwargs if '_id' in parameter_name]
299299
if len(id_parameters) == 1:
300300
id_ = kwargs[id_parameters[0]]

0 commit comments

Comments
 (0)