Skip to content

Handle enumerate and generator inputs to from_map#9066

Merged
jsignell merged 2 commits intodask:mainfrom
rjzamora:from-map-enumerate
May 11, 2022
Merged

Handle enumerate and generator inputs to from_map#9066
jsignell merged 2 commits intodask:mainfrom
rjzamora:from-map-enumerate

Conversation

@rjzamora
Copy link
Copy Markdown
Member

@rjzamora rjzamora commented May 10, 2022

The new from_map API does not correclty handle when elements of iterables are not of type list. This PR should allow us to handle enumerate and generator objects correctly.

@jsignell jsignell merged commit c2bcf05 into dask:main May 11, 2022
@jsignell
Copy link
Copy Markdown
Member

Thank you both!

@rjzamora rjzamora deleted the from-map-enumerate branch May 11, 2022 15:55
["A", "B", "B", "C", "C", "C"],
index=[0, 0, 1, 0, 1, 2],
)
assert_eq(ddf.compute(), expect)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is this .compute() needed?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Oh no, I missed that. No - the compute() is not necessary.

erayaslan pushed a commit to erayaslan/dask that referenced this pull request May 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TypeError when using from_map on enumerate object

4 participants