-
Notifications
You must be signed in to change notification settings - Fork 78
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 messages #754
Conversation
Codecov ReportBase: 91.72% // Head: 88.51% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #754 +/- ##
==========================================
- Coverage 91.72% 88.51% -3.21%
==========================================
Files 40 73 +33
Lines 2935 3101 +166
==========================================
+ Hits 2692 2745 +53
- Misses 243 356 +113
Flags with carried forward coverage won't be shown. Click here to find out more. Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
else: | ||
features = info.features | ||
|
||
if features and len(features) > columns_max_number: | ||
raise TooManyColumnsError( | ||
f"Too many columns. The maximum supported number of columns is {columns_max_number}." | ||
f"The number of columns ({len(features)}) exceeds the maximum supported number of columns" | ||
f" ({columns_max_number})." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we suggest to reduce the number of columns?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, good idea!
Generally, it comes from a flaw in the design of the dataset (not "tidy data"), but anyway, people have the right to do what they want.
So, I think we just want to say it's a limitation of the dataset viewer, and that by reducing the number of columns, it would be working again
workers/datasets_based/src/datasets_based/workers/first_rows.py
Outdated
Show resolved
Hide resolved
workers/datasets_based/src/datasets_based/workers/first_rows.py
Outdated
Show resolved
Hide resolved
The documentation is not available anymore as the PR was closed or merged. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice, thanks!
Just one comment (that I put everywhere to be sure no to forgot one instance): are we sure the dataset contains a loading script, when we ask the user to fix it?
If the dataset has no loading script, maybe it's better not mentioning it.
Also: there are two possible users:
- the user is the maintainer of the dataset: they will be able to apply the advice
- the user is seeing the page of a dataset they do not own: they should open a discussion, so that the maintainer can fix it (note that the viewer already directs to opening a discussion in that case).
Which one are we directing the messages to?
chart/static-files/openapi.json
Outdated
"value": "SplitsResponseNotReadyError" | ||
}, | ||
"SplitsNamesError": { | ||
"summary": "Cannot get the split names for the dataset.", | ||
"summary": "Cannot get the split names for the dataset. Please fix your loading script.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
btw, is it possible to get this error even if the dataset does not contain a loading script?
chart/static-files/openapi.json
Outdated
@@ -196,19 +196,19 @@ | |||
"value": "FirstRowsResponseNotReady" | |||
}, | |||
"InfoError": { | |||
"summary": "The info cannot be fetched for the dataset config.", | |||
"summary": "The info cannot be fetched for the config of the dataset. Please fix your loading script.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same question: is this error only possible if a loading script exists?
chart/static-files/openapi.json
Outdated
"value": "InfoError" | ||
}, | ||
"FeaturesError": { | ||
"summary": "The split features (columns) cannot be extracted.", | ||
"summary": "Cannot extract the features (columns) for the split of the config of the dataset. Please fix your loading script.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same question: is this error only possible if a loading script exists?
chart/static-files/openapi.json
Outdated
"value": "FeaturesError" | ||
}, | ||
"StreamingRowsError": { | ||
"summary": "Cannot load the dataset split (in streaming mode) to extract the first rows.", | ||
"summary": "Cannot load the dataset split (in streaming mode) to extract the first rows. Please make your loading script support streaming", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same question: is this error only possible if a loading script exists?
chart/static-files/openapi.json
Outdated
"value": "StreamingRowsError" | ||
}, | ||
"NormalRowsError": { | ||
"summary": "Cannot load the dataset split (in normal download mode) to extract the first rows.", | ||
"summary": "Cannot load the dataset split (in normal download mode) to extract the first rows. Please fix your loading script.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same question: is this error only possible if a loading script exists?
except Exception as err: | ||
raise ConfigNamesError("Cannot get the configuration names for the dataset.", cause=err) from err | ||
raise ConfigNamesError( | ||
"Cannot get the config names for the dataset. Please fix your loading script.", cause=err |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same question: is this error only possible if a loading script exists?
@@ -103,9 +103,12 @@ def compute_split_names_response( | |||
for split in get_dataset_split_names(path=dataset, config_name=config, use_auth_token=use_auth_token) | |||
] | |||
except _EmptyDatasetError as err: | |||
raise EmptyDatasetError("The dataset is empty.", cause=err) from err | |||
raise EmptyDatasetError("The dataset is empty. Please fix your loading script.", cause=err) from err |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same question: is this error only possible if a loading script exists?
except Exception as err: | ||
raise SplitNamesError("Cannot get the split names for the dataset and config.", cause=err) from err | ||
raise SplitNamesError( | ||
f"Cannot get the split names for the config '{config}' of the dataset. Please fix your loading script.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same question: is this error only possible if a loading script exists?
@@ -118,9 +118,11 @@ def compute_splits_response( | |||
try: | |||
split_items = get_dataset_split_full_names(dataset=dataset, use_auth_token=use_auth_token) | |||
except _EmptyDatasetError as err: | |||
raise EmptyDatasetError("The dataset is empty.", cause=err) from err | |||
raise EmptyDatasetError("The dataset is empty. Please fix your loading script.", cause=err) from err |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same question: is this error only possible if a loading script exists?
except Exception as err: | ||
raise SplitsNamesError("Cannot get the split names for the dataset.", cause=err) from err | ||
raise SplitsNamesError( | ||
"Cannot get the split names for the dataset. Please fix your loading script.", cause=err |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same question: is this error only possible if a loading script exists?
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Feel free to merge! |
Related to: