Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[ENH] V1 → V2 API Migration - setups#1619

Merged
PGijsbers merged 271 commits intoopenml:mainopenml/openml-python:mainfrom
EmanAbdelhaleem:setups-migEmanAbdelhaleem/openml-python:setups-migCopy head branch name to clipboard
Mar 25, 2026
Merged

[ENH] V1 → V2 API Migration - setups#1619
PGijsbers merged 271 commits intoopenml:mainopenml/openml-python:mainfrom
EmanAbdelhaleem:setups-migEmanAbdelhaleem/openml-python:setups-migCopy head branch name to clipboard

Conversation

@EmanAbdelhaleem
Copy link
Contributor

@EmanAbdelhaleem EmanAbdelhaleem commented Jan 20, 2026

Fixes #1625
Depends on #1576
Related to #1575

Details
This PR implements Setups resource, and refactor its existing functions

@codecov-commenter
Copy link

codecov-commenter commented Jan 20, 2026

Codecov Report

❌ Patch coverage is 72.26891% with 33 lines in your changes missing coverage. Please review.
✅ Project coverage is 54.46%. Comparing base (fe58eb0) to head (981f2b8).

Files with missing lines Patch % Lines
openml/_api/resources/setup.py 71.42% 24 Missing ⚠️
openml/_api/clients/http.py 71.42% 8 Missing ⚠️
openml/setups/functions.py 80.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1619      +/-   ##
==========================================
+ Coverage   53.75%   54.46%   +0.70%     
==========================================
  Files          61       61              
  Lines        5062     5086      +24     
==========================================
+ Hits         2721     2770      +49     
+ Misses       2341     2316      -25     

☔ 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 mentioned this pull request Jan 21, 2026
18 tasks
@EmanAbdelhaleem EmanAbdelhaleem marked this pull request as ready for review January 21, 2026 23:13
Copy link
Collaborator

@geetu040 geetu040 left a comment

Choose a reason for hiding this comment

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

some old tests will fail because the cache path has changed

old: tests/files/org/openml/test/tasks/1882
new: tests/files/org/openml/test/api/v1/xml/task/1882

regarding this we can do the following, as i've done in this PR

  • move the relevant cache test files to new directory - (reference - setup/1/body.xml)
    • create new directory tests/files/org/openml/test/api/v1/xml/[resource]/[id]/, move the description.xml file there and rename it to body.xml
    • inshort a file tests/files/org/openml/test/setups/1/description.xml becomes tests/files/org/openml/test/api/v1/xml/setup/1/body.xml
    • move other downloadable files from minio and HTTPClient.download accordingly
  • if there are any tests that rely on cache, update them by mocking Session.request - (reference - test_setup_functions)
  • update conftest.py with new file paths, for now you can manually hardcode the new paths and remove this resource from the code earlier, we can later clean this up - (reference - conftest.py)

FYI: @satvshr @Omswastik-11 @JATAYU000

Copy link
Collaborator

@geetu040 geetu040 left a comment

Choose a reason for hiding this comment

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

@EmanAbdelhaleem Thanks for the PR. Nicely done!
I have updated the PR to sync with latest changes in base PR.

@PGijsbers please review/merge.

Copy link
Collaborator

@PGijsbers PGijsbers left a comment

Choose a reason for hiding this comment

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

I left a few remarks, additionally the ability to add and remove tags was added, but I did not see any tests added that test this new functionality. Those tests should be added.

I believe we had briefly discussed this before on a different PR, but I can't find it easily. Why store the response body as a binary file? The response is always text (either xml or json, potentially also some error text but text regardless). I do not think it is good to store these files as binary because it doesn't play well with git -and- because it makes it hard to review the file content (see for example the recent xz/ssh exploit). I would prefer these files have an extension that matches their content, and if that needs to be more generic, then we should use .txt.

openml/_api/resources/setup.py Show resolved Hide resolved
openml/_api/resources/setup.py Outdated Show resolved Hide resolved
openml/_api/resources/setup.py Outdated Show resolved Hide resolved
openml/_api/resources/setup.py Outdated Show resolved Hide resolved
tests/test_api/test_setup.py Outdated Show resolved Hide resolved
@geetu040 geetu040 requested a review from PGijsbers March 25, 2026 05:10
@geetu040
Copy link
Collaborator

I left a few remarks, additionally the ability to add and remove tags was added, but I did not see any tests added that test this new functionality. Those tests should be added.

I have removed tagging from OpenMLSetup, since it was unrelated to this PR and already tracked in #1648

Why store the response body as a binary file?

I stored it in binary since the requests.Response object saves the content in binary format, therefore I used the native extension, but you point makes sense as well. I have updated the cache to store content in relevant files: body.json, body.xml otherwise body.txt and the implementation is clean, so I guess we are fine this way.


@PGijsbers This PR is up for review/merge.

@PGijsbers PGijsbers merged commit ec3ed63 into openml:main Mar 25, 2026
27 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.

[ENH] V1 → V2 API Migration - setups

8 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.