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

fix: make from_iter require iterables! #2353

Merged
merged 5 commits into from
Apr 5, 2023

Conversation

agoose77
Copy link
Collaborator

@agoose77 agoose77 commented Apr 3, 2023

Although from_iter can understand non-iterables, I think we really want to restrict it to only returning layouts/arrays.

@agoose77 agoose77 requested a review from jpivarski April 3, 2023 16:54
@agoose77 agoose77 temporarily deployed to docs-preview April 3, 2023 17:05 — with GitHub Actions Inactive
@codecov
Copy link

codecov bot commented Apr 3, 2023

Codecov Report

Merging #2353 (14157d3) into main (6a24ed0) will decrease coverage by 0.01%.
The diff coverage is 66.66%.

Additional details and impacted files
Impacted Files Coverage Δ
src/awkward/operations/ak_from_iter.py 91.30% <66.66%> (-3.70%) ⬇️

Copy link
Member

@jpivarski jpivarski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just comments for now because I'm a little wary of this one. I get that you're trying to make the function name more literal, and therefore more guessable without recourse to the documentation. I'm hesitant because there might be some things people expect would work, even though they're not literally iterables.

If the tests pass, then if there are any such cases, they're not explicitly being tested.

src/awkward/operations/ak_to_layout.py Outdated Show resolved Hide resolved
src/awkward/operations/ak_from_iter.py Outdated Show resolved Hide resolved
src/awkward/operations/ak_from_iter.py Show resolved Hide resolved
@agoose77 agoose77 force-pushed the agoose77/fix-from-iter-non-iterable branch from e23ff71 to 8c48428 Compare April 4, 2023 13:42
@agoose77 agoose77 temporarily deployed to docs-preview April 4, 2023 13:52 — with GitHub Actions Inactive
Copy link
Member

@jpivarski jpivarski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that the PR is only about rejecting non-iterables, and you can merge when ready.

Should I turn the problem with broadcasting strings into an issue?

@agoose77 agoose77 temporarily deployed to docs-preview April 5, 2023 18:56 — with GitHub Actions Inactive
@agoose77 agoose77 merged commit 6bcb94f into main Apr 5, 2023
@agoose77 agoose77 deleted the agoose77/fix-from-iter-non-iterable branch April 5, 2023 22:37
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.

None yet

2 participants