[ENH] Add OpenMLAuthenticationError for clearer API key error handling#1570
[ENH] Add OpenMLAuthenticationError for clearer API key error handling#1570Omswastik-11 wants to merge 10 commits intoopenml:mainfrom
OpenMLAuthenticationError for clearer API key error handling#1570Conversation
OpenMLAuthenticationError for clearer API key error handling
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1570 +/- ##
==========================================
- Coverage 52.08% 52.08% -0.01%
==========================================
Files 36 36
Lines 4360 4364 +4
==========================================
+ Hits 2271 2273 +2
- Misses 2089 2091 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
geetu040
left a comment
There was a problem hiding this comment.
Really Nice.
It was important to identify correct usage of OpenMLNotAuthorizedError and OpenMLAuthenticationError in the sdk, which looks all good.
Ready to be merged.
fkiraly
left a comment
There was a problem hiding this comment.
Waitasec, could you kindly explain why the OpenMLNotAuthorizedError gets removed?
|
@fkiraly it is not completely removed but replaced . I have done it according to this : |
|
if i understand @SimonBlanke correctly, he does not want it replaced, but a new class added? |
@fkiraly the new class is added and the previous one is still there: openml/exceptions.py the confusion is probably coming from openml/_api_calls.py where |
fkiraly
left a comment
There was a problem hiding this comment.
Ah, you are right, I was confused - this is a removed import, not a removed export.
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