Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The parameters of an endpoint should not change the response format #1665

Open
severo opened this issue Aug 10, 2023 · 0 comments
Open

The parameters of an endpoint should not change the response format #1665

severo opened this issue Aug 10, 2023 · 0 comments
Labels
api bug Something isn't working P2 Nice to have

Comments

@severo
Copy link
Collaborator

severo commented Aug 10, 2023

The optional parameters should only change the response's content, not structure.

For example, the length parameter in /rows reduces the number of returned rows.

But for /parquet, for example, if we ask for the config level (https://datasets-server.huggingface.co/parquet?dataset=mnist), we get the list of features along with the list of files, while we don't have features when we only ask for the dataset level (https://datasets-server.huggingface.co/parquet?dataset=mnist&config=mnist). Also, for /info, the structure of dataset_info is not the same for dataset level and config level.

For /size, the fields' names and types change depending on whether the config parameter is passed or not. For example, https://datasets-server.huggingface.co/size?dataset=mnist gives .size.configs, while https://datasets-server.huggingface.co/size?dataset=mnist&config=mnist give .size.config.

Similarly, the failed and pending entries are weird. They only show for "aggregated" levels (i.e., dataset if the response is generated at config level, dataset, and config if the response is generated at split level). Currently:

  • /splits, dataset level
  • /parquet, dataset level
  • /info, dataset level
  • /size, dataset level
  • /opt-in-out-urls, dataset and config levels

About "failed" and "pending", also note that their type is different depending on the endpoint. Just one example: "failed" in /splits return the error, while "failed" in /parquet return the parameters of the previous job.

Also: in parquet and info, instead of not setting "split", we set it to None (which gives null in JSON, instead of not having the field).

@severo severo added bug Something isn't working api P1 Not as needed as P0, but still important/wanted labels Aug 10, 2023
@severo severo added P2 Nice to have and removed P1 Not as needed as P0, but still important/wanted labels Nov 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api bug Something isn't working P2 Nice to have
Projects
None yet
Development

No branches or pull requests

1 participant