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

Outdated DataFrame.partition_by docstring for as_dict behavior #17467

Closed
d-laub opened this issue Jul 7, 2024 · 1 comment
Closed

Outdated DataFrame.partition_by docstring for as_dict behavior #17467

d-laub opened this issue Jul 7, 2024 · 1 comment
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@d-laub
Copy link

d-laub commented Jul 7, 2024

Description

Documentation for DataFrame.partition_by v1.0.0 does not reflect changes from #16793

as_dict
Return a dictionary instead of a list. The dictionary keys are tuples of the distinct group values that identify each group. If a single string was passed to by, the keys are a single value instead of a tuple.

This conflicts with the runtime behavior where the dictionary keys are tuples when by is a string.

>>> df = pl.DataFrame({"foo": ["a", "a", "b"], "bar": [1, 2, 3]})
>>> print(df.partition_by("foo", as_dict=True).keys())
dict_keys([('a',), ('b',)])

Link

https://docs.pola.rs/api/python/stable/reference/dataframe/api/polars.DataFrame.partition_by.html#polars.DataFrame.partition_byddd

@d-laub d-laub added the documentation Improvements or additions to documentation label Jul 7, 2024
@nameexhaustion
Copy link
Collaborator

Fixed by #17394

@nameexhaustion nameexhaustion changed the title docs(python): Update DataFrame.partition_by docstring to match new behavior Outdated DataFrame.partition_by docstring for as_dict behavior Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants