openml-python
openml-python copied to clipboard
Error in updating dataset description
Description
When a dataset description is updated, it gives the following error:
Steps/Code to Reproduce
# Import OpenML
import openml
# Configure API Key
openml.config.apikey = 'API_KEY'
# Description file : loading from .md file
micro_markdown = "PLK.md"
# Dataset ID
dataset_id = 44238
# Download dataset without data
openml.datasets.get_dataset(dataset_id, False)
# Read MD file
f_micro = open(micro_markdown, "r")
micro_md = f_micro.readlines()
f_micro.close()
# update description on OpenML
openml.datasets.edit_dataset(dataset_id, description=micro_md)
This is because the description field expects a string, and the provided value is a list of strings, try using the read function instead:
- micro_md = f_micro.readlines()
+ micro_md = f_micro.read()
This results in the text being uploaded, you can see a preview here: https://test.openml.org/d/20 If you are not satisfied with that result and want to experiment around, you can also use the test server:
import openml
openml.config.start_using_configuration_for_example()
openml.config.datasets.edit_dataset(20, description=...)
Thank you for the quick fix. It now leads to another issue:
Between these two screenshots the content of ".md" "file is displayed.
It looks like there is some encoding issue but not sure about it.
Descriptions are update for one dataset "PLK" but not working for the rest. https://www.openml.org/search?type=data&sort=runs&id=44238&status=active https://www.openml.org/search?type=data&sort=runs&id=44282&status=active https://www.openml.org/search?type=data&sort=runs&id=44317&status=active
Between these two screenshots the content of ".md" "file is displayed.
Not sure what you mean with that. Can you provide the problematic markdown file(s)? Either per e-mail as files or
here in code block format
Related to https://github.com/openml/OpenML/issues/911. In my opinion, we should take the following step:
- change the allowed characters that are legal in a data set description
- improve the error message (and update local verification)