openml-python
openml-python copied to clipboard
Fix: Use UserWarning for unauthenticated duplicate run checks (Fixes #1210)
Description
This PR fixes #1210 by improving the warning message when avoid_duplicate_runs=True is used without an API key.
Changes:
- Replaced the generic
RuntimeWarningwith aUserWarning. - Updated the warning message to explicitly inform the user that duplicate runs cannot be checked server-side without authentication.
- Changed the condition check to explicitly look for
openml.config.apikey is None.
Type of change
- [x] Bug fix (non-breaking change which fixes an issue)
How Has This Been Tested?
I verified this locally by mocking openml.runs.run_model_on_task with apikey=None and asserting that the new UserWarning is triggered correctly.
Hi @PGijsbers,
I have submitted this fix for #1210. I updated the warning to a UserWarning and added the specific check for the missing API key as discussed.
Could you please review this when you have a moment? It looks like the GitHub workflows (CI) are waiting for approval to run as well.
Thanks!