Skip to content

Conversation

@v-parmar
Copy link
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
Copy link

codecov-commenter commented Apr 18, 2023

Codecov Report

Patch coverage: 50.00% and project coverage change: -0.08 ⚠️

Comparison is base (fb9f9eb) 85.24% compared to head (f7c583b) 85.16%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1246      +/-   ##
===========================================
- Coverage    85.24%   85.16%   -0.08%     
===========================================
  Files           38       38              
  Lines         5008     5010       +2     
===========================================
- Hits          4269     4267       -2     
- Misses         739      743       +4     
Impacted Files Coverage Δ
openml/runs/functions.py 83.85% <50.00%> (-0.41%) ⬇️

... and 5 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Collaborator

@PGijsbers PGijsbers left a comment

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 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
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
Collaborator

Sorry, missed the update. LGTM. Thanks for your contribution!

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