Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Update functions.py
  • Loading branch information
v-parmar authored Apr 25, 2023
commit 995f896cf69456f6b00b93d3c6521cc3f3c6f54e
6 changes: 3 additions & 3 deletions openml/runs/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@ def run_model_on_task(
if avoid_duplicate_runs and not config.apikey:
warnings.warn(
"avoid_duplicate_runs is set to True, but no API key is set. "
"Please set your API key in the OpenML configuration file "
"or pass it directly to the function.",
DeprecationWarning,
"Please set your API key in the OpenML configuration file, see"
"https://openml.github.io/openml-python/main/examples/20_basic/introduction_tutorial.html#authentication"
"for more information on authentication.",
)
Comment on lines +102 to +107
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
warnings.warn(
"avoid_duplicate_runs is set to True, but no API key is set. "
"Please set your API key in the OpenML configuration file "
"or pass it directly to the function.",
DeprecationWarning,
)
warnings.warn(
"avoid_duplicate_runs is set to True, but no API key is set. "
"Please set your API key in the OpenML configuration file, see"
"https://openml.github.io/openml-python/main/examples/20_basic/introduction_tutorial.html#authentication"
" for more information on authentication.",
)

Two changes:

  1. I don't think DeprecationWarning is appropriate here because we are not informing about changed behavior/signature of the function, I would favor the UserWarning (which is the default warning type, so I left that argument implicit).
  2. There is no way to pass the API key to the function, so that help text is incorrect. I updated the text to point to the documentation.


# TODO: At some point in the future do not allow for arguments in old order (6-2018).
Expand Down