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

improve error message for dataset upload #927

Merged
merged 2 commits into from
Jul 7, 2020
Merged

improve error message for dataset upload #927

merged 2 commits into from
Jul 7, 2020

Conversation

mfeurer
Copy link
Collaborator

@mfeurer mfeurer commented Jul 6, 2020

closes #920

Given the following piece of code:

import openml
import sklearn.datasets
import pandas as pd
import numpy as np

X, y = sklearn.datasets.make_classification()
data = pd.DataFrame(X)
data['y'] = y

my_dataset = openml.datasets.create_dataset(
    name="My cool dataset",
    description="foo",
    creator="bar",
    contributor=None,
    collection_date='01-01-2011',
    language='English',
    licence=None,
    default_target_attribute='label',
    row_id_attribute=None,
    ignore_attribute=None,
    citation="foo",
    attributes='auto',
    data=data,
    version_label='1.0',
)

the error message improves from

ValueError: Invalid symbols in name: My cool dataset

to

ValueError: Invalid symbols ' ' in name: My cool dataset

@PGijsbers
Copy link
Collaborator

Don't forget to update the unit tests.

@mfeurer mfeurer requested a review from PGijsbers July 7, 2020 13:43
@codecov-commenter
Copy link

codecov-commenter commented Jul 7, 2020

Codecov Report

Merging #927 into develop will decrease coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #927      +/-   ##
===========================================
- Coverage    88.05%   88.05%   -0.01%     
===========================================
  Files           37       37              
  Lines         4363     4521     +158     
===========================================
+ Hits          3842     3981     +139     
- Misses         521      540      +19     
Impacted Files Coverage Δ
openml/datasets/dataset.py 86.57% <100.00%> (+0.59%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8f99ff6...7df0575. Read the comment docs.

@PGijsbers PGijsbers merged commit 525e8a6 into develop Jul 7, 2020
@PGijsbers PGijsbers deleted the fix_920 branch July 7, 2020 19:33
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.

Better error messages for string constraints
3 participants