openml / openml/OpenML

list setup output structure sometimes very different

Open
#740 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
755
Forks
128
PR merge metrics
No merged PRs in 30d

Description

Hi,
not sure if I can explain what I mean properly but: for the list/setup API call I have to write ugly postprocessing code to make sure that the structure of the API output is uniformly. This makes the function difficult to maintain when server changes happen, as I then have to rewrite the ugly postprocessing code. Here some examples:

  1. https://test.openml.org/api/v1/json/setup/list/limit/1 (this has only a setup and flow slot)
  2. https://test.openml.org/api/v1/json/setup/list/limit/10 (this additionally has parameter slot, which shows the flow.id but not the setup.id, to get the setup.id for each parameter I have to use the parent field)

I think I would be happy if you could only output show the parameter field with the following subfields (see comments) and always make sure that the output has the same structure (i.e. empty fields are shown with a null value or something like this):

<oml:id>53004</oml:id> #  I don't need this
<oml:flow_id>5685</oml:flow_id> # this is nice to have, also setup.id would be great
<oml:setup_id>29337</oml:setup_id> # I added this field manually now
<oml:full_name>mlr.classif.rpart.tuned(6)_openml.normal.kind</oml:full_name>
<oml:parameter_name>openml.normal.kind</oml:parameter_name>
<oml:data_type>discrete</oml:data_type>
<oml:default_value>Inversion</oml:default_value>
<oml:value>Inversion</oml:value>

The difficult maintaining part is that I always have to do if-else conditions to check which structure the API outputs (as I never know this beforehand). So having an API that always makes sure to output an unified structure makes this easier for clients. Do you think you can change this?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Compare the two setup list API responses linked in the issue, especially their setup, flow, and parameter fields. Define the unified response structure from the requested parameter subfields and verify that missing values are represented consistently; done means clients no longer need conditional postprocessing for these response shapes.

Written by the indexing model from the issue text.

Assessment

Domain
api
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.