Skip to content

Fix: Use UserWarning for unauthenticated duplicate run checks (Fixes #1210) - #1484

Merged
PGijsbers merged 7 commits into
openml:mainfrom
Prachi194agrawal:fix/1210-auth-warning
Nov 10, 2026
Merged

PGijsbers merged 7 commits into
openml:mainfrom
Prachi194agrawal:fix/1210-auth-warning

Conversation

@Prachi194agrawal

Copy link
Copy Markdown
Contributor

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 RuntimeWarning with a UserWarning.
  • 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

  • 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.

@Prachi194agrawal

Copy link
Copy Markdown
Contributor Author

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!

Comment thread openml/runs/functions.py Resolved
Copilot AI balanced review requested due to automatic review settings November 9, 2026 17:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 51.24%. Comparing base (496ac32) to head (377af26).

Files with missing lines Patch % Lines
openml/runs/functions.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1484      +/-   ##
==========================================
- Coverage   51.41%   51.24%   -0.17%     
==========================================
  Files          63       63              
  Lines        5565     5565              
==========================================
- Hits         2861     2852       -9     
- Misses       2704     2713       +9     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@PGijsbers PGijsbers left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for taking the time to contribute. We were flooded with PRs and unable to process them, so sorry for the delay in our response. The linked issue was supposed to be closed. However, I do think the clarification that the run proceeds with the risk of duplicates is a useful addition. Moreover, the UserWarning is probably more appropriate than the RuntimeWarning. So I am merging this now. Thanks again!

@PGijsbers
PGijsbers merged commit 01079a5 into openml:main Nov 10, 2026
24 checks passed
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.

Add warning to run_model_on_task with avoid duplicates if no authentication

4 participants