Added warning to run_model_on_task to avoid duplicates if no authentication by v-parmar · Pull Request #1246 · openml/openml-python · GitHub
Skip to content

Added warning to run_model_on_task to avoid duplicates if no authentication#1246

Merged
PGijsbers merged 3 commits into
openml:developfrom
v-parmar:v-parmar-patch-1
Jun 13, 2023
Merged

Added warning to run_model_on_task to avoid duplicates if no authentication#1246
PGijsbers merged 3 commits into
openml:developfrom
v-parmar:v-parmar-patch-1

Conversation

@v-parmar

Copy link
Copy Markdown
Contributor

Added warning to run_model_on_task to avoid duplicates if no authentication

Reference Issue

#1210

v-parmar and others added 2 commits April 18, 2023 19:33
Added warning to run_model_on_task to avoid duplicates if no authentication
@codecov-commenter

codecov-commenter commented Apr 18, 2023

Copy link
Copy Markdown

@PGijsbers PGijsbers left a comment

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.

Thanks for your contribution! Please see my suggestion

Comment thread openml/runs/functions.py
Comment on lines +102 to +107
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,
)

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.

@PGijsbers

Copy link
Copy Markdown
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants