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

[Datasets] Improve iter(dataset) error message #30399

Closed
bveeramani opened this issue Nov 17, 2022 · 0 comments · Fixed by #30575
Closed

[Datasets] Improve iter(dataset) error message #30399

bveeramani opened this issue Nov 17, 2022 · 0 comments · Fixed by #30575
Assignees
Labels
data Ray Data-related issues enhancement Request for new feature and/or capability P2 Important issue, but not time-critical UX The issue is not only about technical bugs

Comments

@bveeramani
Copy link
Member

Description

If you try to iterate through a dataset, you get an unhelpful error.

>>> for x in ds:
...     pass
... 
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'Dataset' object is not iterable

We should provide a more descriptive error along the lines of:

TypeError: You're trying to iterate through a dataset, but this isn't supported. If you're trying to view records, call `Dataset.take`. If you're trying to transform records, call `Dataset.map_batches`.

Use case

New users may intuitively try to iterate through a dataset. The error message should redirect users to the appropriate methods.

@bveeramani bveeramani added enhancement Request for new feature and/or capability data Ray Data-related issues labels Nov 17, 2022
@bveeramani bveeramani self-assigned this Nov 17, 2022
@Wendi-anyscale Wendi-anyscale added the UX The issue is not only about technical bugs label Nov 17, 2022
@clarkzinzow clarkzinzow added P2 Important issue, but not time-critical air labels Nov 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data Ray Data-related issues enhancement Request for new feature and/or capability P2 Important issue, but not time-critical UX The issue is not only about technical bugs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants