Refactor Error Handling: Introducing Structured, Typed Exceptions for Clearer Server & Validation Errors
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 25/100
- issue の種類
- リファクタリング
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- python
調査の方向性
Start by reviewing the completed exception work in exceptions.py and the HTTP/XML mapping in _api_calls.py. Run the existing test suite, then update tests including test_too_long_uri to cover typed exceptions and backward compatibility. Done means the tests pass and the error-handling documentation includes retry, missing-resource, and permission examples.
索引モデルが issue の本文から書いたものです。
説明
Problem Summary
OpenML-Python currently funnels diverse server and client-side errors into the broad exceptions OpenMLServerError and OpenMLServerException. This limits users and downstream systems from:
- Distinguishing retryable vs non-retryable failures
- Providing meaningful user-facing error messages
- Programmatically responding to rate limits, missing resources, or validation failures
- Debugging large-scale uploads where different failure modes look identical
Current Situation
All these different scenarios raise the same generic exception:
try:
openml.datasets.get_dataset(999999)
except OpenMLServerError:
# Could be dataset missing, rate limit, timeout, validation issue, DB issue, etc.
pass
Proposed Solution
Introducing a hierarchical exception system with specific, typed error classes:
OpenMLServerError (existing)
├── OpenMLURITooLongError (HTTP 414)
├── OpenMLRateLimitError (HTTP 429)
├── OpenMLNotFoundError (HTTP 404)
├── OpenMLTimeoutError (HTTP 408, 504)
├── OpenMLServiceUnavailableError (HTTP 503)
├── OpenMLAuthenticationError (missing/invalid API key)
├── OpenMLNotAuthorizedError (insufficient permissions)
│
└── OpenMLServerException (existing)
├── OpenMLServerNoResult (existing - empty results)
├── OpenMLValidationError (code 163, validation failures)
└── OpenMLDatabaseConnectionError (code 107, temporary DB issues)
Key Benefits
- Typed Exceptions → programmatic handling (except OpenMLRateLimitError: retry).
- HTTP & OpenML Code Mapping → consistent error interpretation.
- Rich Metadata → e.g., retry_after, resource_type, timeout_seconds.
- Backward Compatible → all classes still inherit existing base exceptions.
I will systematically link the changes to this thread. Hope this helps users and contributors alike.
Implementation Checklist
PR1 — Typed Exceptions (exceptions.py only)
- Add new typed exception classes
- Organize categories (HTTP, validation, auth, timeout, DB, etc.)
- Keep backward compatibility
PR2 — Server Error Mapping (_api_calls.py)
- Map HTTP status codes → typed exceptions
- Map OpenML XML error codes → typed exceptions
- Add message-based fallbacks
- Add pre-check for overly long URLs
PR3 — Test Suite Updates
- Update tests to expect typed exceptions
- Fix test_too_long_uri with pre-request check
- Ensure full backward compatibility
PR4 — Documentation
- Update error-handling documentation
- Add examples for retry, missing resources, permissions
- Submit PR4
- 主要言語
- Python
- スター
- 361
- フォーク
- 296
- 平均マージ
- 2日 20時間
- マージ済み PR(30日)
- 2
環境構築
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
openml/openml-python のほかの issue
-
[ENH] list_estimation_procedures() should include the procedure IDs対応中かも @Jayant-kernel が 2 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
openml/openml-python#1750 · コメント 3 件 · 担当者 1 名 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
openml/openml-python#1749 ·
メンテナーはふだん 2 日以内に返信
-
Documentation Good First Issue
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
openml/openml-python#1708 · コメント 8 件 ·
メンテナーはふだん 2 日以内に返信
-
Good First Issue module:Run testing
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
openml/openml-python#1646 · コメント 8 件 · リアクション 2 件 ·
メンテナーはふだん 2 日以内に返信
-
Good First Issue module:Data testing
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
openml/openml-python#1644 · コメント 4 件 ·
メンテナーはふだん 2 日以内に返信
openml/openml-python の issue をすべて見る
似ている issue
-
docs pydanty:is-working
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
pydantic/pydantic-ai#8863 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
run-llama/llama_index#23278 ·
メンテナーはふだん 2 日以内に返信
-
documentation from-review-extraction github-actions priority: low severity:nit
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
LearningCircuit/local-deep-research#6946 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
oracle/langchain-oracle#323 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
tenstorrent/tt-metal#58057 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信