Skip to content

Commit 333b068

Browse files
Added warning to run_model_on_task to avoid duplicates if no authentication (#1246)
* Update runs/functions.py Added warning to run_model_on_task to avoid duplicates if no authentication * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update functions.py --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 3f59841 commit 333b068

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

openml/runs/functions.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,13 @@ def run_model_on_task(
9898
flow : OpenMLFlow (optional, only if `return_flow` is True).
9999
Flow generated from the model.
100100
"""
101+
if avoid_duplicate_runs and not config.apikey:
102+
warnings.warn(
103+
"avoid_duplicate_runs is set to True, but no API key is set. "
104+
"Please set your API key in the OpenML configuration file, see"
105+
"https://openml.github.io/openml-python/main/examples/20_basic/introduction_tutorial.html#authentication"
106+
"for more information on authentication.",
107+
)
101108

102109
# TODO: At some point in the future do not allow for arguments in old order (6-2018).
103110
# Flexibility currently still allowed due to code-snippet in OpenML100 paper (3-2019).

0 commit comments

Comments
 (0)