[ENH] Add OpenMLAuthenticationError for clearer API key error handling#1570
Open
Omswastik-11 wants to merge 7 commits intoopenml:mainfrom
Open
[ENH] Add OpenMLAuthenticationError for clearer API key error handling#1570Omswastik-11 wants to merge 7 commits intoopenml:mainfrom
OpenMLAuthenticationError for clearer API key error handling#1570Omswastik-11 wants to merge 7 commits intoopenml:mainfrom
Conversation
OpenMLAuthenticationError for clearer API key error handling
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1570 +/- ##
==========================================
+ Coverage 52.04% 52.06% +0.02%
==========================================
Files 36 36
Lines 4333 4337 +4
==========================================
+ Hits 2255 2258 +3
- Misses 2078 2079 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR introduces a new
OpenMLAuthenticationErrorexception to clearly distinguish authentication errors (invalid or missing API key) from authorization errors (valid API key without sufficient permissions).Changes
New Exception
Added
OpenMLAuthenticationErrorinexceptions.pyInherits from
OpenMLServerErrorfor consistencyAutomatically appends helpful guidance with links to:
Includes a clear docstring explaining the difference between authentication and authorization errors
Updated Error Handling
Updated
_api_calls.pyto:OpenMLAuthenticationErrorfor authentication failuresTests Updated
Updated
test_authentication_endpoints_requiring_api_key_show_relevant_help_linkOpenMLAuthenticationErrorinstead ofOpenMLNotAuthorizedErrorFixes #1562