-
-
Notifications
You must be signed in to change notification settings - Fork 27
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
Add support for DataFrame.melt
#1049
Conversation
dask_expr/_collection.py
Outdated
meta = make_meta( | ||
meta_nonempty(self._meta).melt( | ||
id_vars=id_vars, | ||
value_vars=value_vars, | ||
var_name=var_name, | ||
value_name=value_name, | ||
col_level=col_level, | ||
) | ||
) |
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.
Probably don't need this.
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.
Can you confirm this? Wouldn't want to merge it if we don't need it.
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.
Okay yeah. Default emulation works fine for the tests - Removing the unnecessary logic.
dict(value_vars=["s1", "s2"]), | ||
], | ||
) | ||
def test_melt(kwargs): |
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.
Test copied from dask/dask for now.
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.
Did you run the dask/dask melt tests on this to make sure that all of them are passing?
We'd also need a PR that enables those tests on CI
dask_expr/_collection.py
Outdated
meta = make_meta( | ||
meta_nonempty(self._meta).melt( | ||
id_vars=id_vars, | ||
value_vars=value_vars, | ||
var_name=var_name, | ||
value_name=value_name, | ||
col_level=col_level, | ||
) | ||
) |
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.
Can you confirm this? Wouldn't want to merge it if we don't need it.
Thanks for the review @phofl ! Sorry - Should have marked this as a draft. I was curious why |
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.
lgtm
can you add it to the api docs as well if not already done in your other PR?
thx |
Closes #1002
dask/dask component: dask/dask#11088
I'm not really sure if
melt
has been left out of the API for a specific reason. This PR adds basic support usingmap_partitions
.