Skip to content

[ENH] Default list_setups to dataframe - #1769

Open
arcwiser wants to merge 1 commit into
openml:mainfrom
arcwiser:fix/list-setups-dataframe
Open

arcwiser wants to merge 1 commit into
openml:mainfrom
arcwiser:fix/list-setups-dataframe

Conversation

@arcwiser

Copy link
Copy Markdown

Metadata

Details

list_setups was the remaining listing API whose default output was not a pandas DataFrame. This changes its default from "object" to "dataframe" while preserving explicit output_format="object" support for callers that need OpenMLSetup instances.

The DataFrame construction now declares its columns so an empty server response returns an empty DataFrame with the same setup_id index and flow_id/parameters columns as a populated response.

Tests cover populated and empty default results without requiring a server. Existing integration coverage now verifies the DataFrame default and the explicit object compatibility path.

Tested on Windows with Python 3.10:

  • pytest tests/test_setups/test_setup_functions.py::test_list_setups_defaults_to_dataframe -q (2 passed)
  • pytest tests/test_setups/test_setup_functions.py -m "not production_server and not test_server" -q (2 passed, 10 deselected)
  • pytest tests/test_setups/test_setup_functions.py::TestSetupFunctions::test_list_setups_output_format -q against the production OpenML API (1 passed)
  • pre-commit run --files openml/setups/functions.py tests/test_setups/test_setup_functions.py (all hooks passed)
  • git diff --check upstream/main HEAD

AI-assisted: yes. The contributor reviewed and is responsible for the submitted changes.

Signed-off-by: arcwiser <arcwiser@users.noreply.github.com>

@L-Agbaria L-Agbaria left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I would personally also prefer if it first introduced a warning regarding future change and conveniently switched "object" to "dict", however it is the last step of a larger change.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 53.68%. Comparing base (0a44155) to head (33803db).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1769   +/-   ##
=======================================
  Coverage   53.68%   53.68%           
=======================================
  Files          63       63           
  Lines        5251     5251           
=======================================
  Hits         2819     2819           
  Misses       2432     2432           

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

This branch has not been deployed

No deployments
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.

Default output_format to "dataframe"

3 participants