Skip to content

Comments

[ENH] V1 → V2 API Migration - core structure#1576

Open
geetu040 wants to merge 180 commits intoopenml:mainfrom
geetu040:migration
Open

[ENH] V1 → V2 API Migration - core structure#1576
geetu040 wants to merge 180 commits intoopenml:mainfrom
geetu040:migration

Conversation

@geetu040
Copy link
Collaborator

Towards #1575

This PR sets up the core folder and file structure along with base scaffolding for the API v1 → v2 migration.

It includes:

  • Skeleton for the HTTP client, backend, and API context
  • Abstract resource interfaces and versioned stubs (*V1, *V2)
  • Minimal wiring to allow future version switching and fallback support

No functional endpoints are migrated yet. This PR establishes a stable foundation for subsequent migration and refactor work.

@geetu040 geetu040 mentioned this pull request Dec 30, 2025
25 tasks
@codecov-commenter
Copy link

codecov-commenter commented Dec 31, 2025

Codecov Report

❌ Patch coverage is 74.45887% with 236 lines in your changes missing coverage. Please review.
✅ Project coverage is 48.60%. Comparing base (7feb2a3) to head (76b92bb).

Files with missing lines Patch % Lines
openml/_config.py 72.63% 78 Missing ⚠️
openml/_api/clients/http.py 69.64% 68 Missing ⚠️
openml/_api/setup/builder.py 29.03% 22 Missing ⚠️
openml/_api/setup/backend.py 66.66% 16 Missing ⚠️
openml/_api/resources/base/versions.py 83.11% 13 Missing ⚠️
openml/_api/resources/base/base.py 71.42% 10 Missing ⚠️
openml/cli.py 0.00% 8 Missing ⚠️
openml/_api/resources/base/fallback.py 84.21% 6 Missing ⚠️
openml/runs/functions.py 0.00% 5 Missing ⚠️
openml/_api_calls.py 70.00% 3 Missing ⚠️
... and 6 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1576      +/-   ##
==========================================
- Coverage   52.82%   48.60%   -4.22%     
==========================================
  Files          37       61      +24     
  Lines        4371     5022     +651     
==========================================
+ Hits         2309     2441     +132     
- Misses       2062     2581     +519     

☔ View full report in Codecov by Sentry.
📢 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.

@geetu040 geetu040 requested a review from mfeurer February 25, 2026 10:10
@geetu040
Copy link
Collaborator Author

Notes for stacked PRs on updating tests

Please follow tests/test_api/test_versions.py to write tests. I have created fixtures in conftest.py, you can use them.

  1. You don't need to create dummy resource, you will import relevant resource from openml._api
  2. create 2 fixtures [resource]_v1 and [resource]_v2 using the clients
  3. write v1-specific tests, v2-specific tests and tests to match outputs of v1 and v2 where applicable
  4. you can choose between mocking or live-server call. I would prefer that delete and post methods are mocked since they are more prune to race conditions.
  5. If you want to access a config, access it directly from openml.config.[var] instead of http_client.[var] or [resource].[var]

FYI: @EmanAbdelhaleem @JATAYU000 @rohansen856 @satvshr @Omswastik-11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants