[MINOR][DOCS] Fix values argument docstring at DataFrame.melt and unpivot#47323
[MINOR][DOCS] Fix values argument docstring at DataFrame.melt and unpivot#47323nugget-cloud wants to merge 4 commits intoapache:masterfrom nugget-cloud:patch-1
Conversation
updated the documentation for the melt fuction as it requires the values argument and it is not optional
| values : str, Column, tuple, list, optional | ||
| Column(s) to unpivot. Can be a single column or column name, or a list or tuple | ||
| for multiple columns. If specified, must not be empty. If not specified, uses all | ||
| columns that are not set as `ids`. |
There was a problem hiding this comment.
Can you keep the indentation? It follows NumPy docstring.
There was a problem hiding this comment.
Should probably fix melt too
There was a problem hiding this comment.
hmm ok
i will change the docs and remove the optional and the last line
unless you want to change unpivot function to incorporate the functionality in the documentation
edited the documentation to reflect the behaviour of the melt function
|
@HyukjinKwon |
| for multiple columns. If specified, must not be empty. If not specified, uses all | ||
| columns that are not set as `ids`. | ||
|
|
||
| values : str, Column, tuple, list |
There was a problem hiding this comment.
can you keep the indentation here?
|
|
|
|
||
| values : str, Column, tuple, list | ||
| Identifies the columns to unpivot. Accepts a single column, a Column object, or a collection (list or tuple) of columns. | ||
| Must be explicitly provided and not left empty. Use to specify the columns for transformation, excluding any ids |
There was a problem hiding this comment.
values is an Optional type parameter, not optional to specify. According to the original docstring, it should be able to take a None value.
I think we can just change the last sentence of the description to be "If None, uses all columns that are not set as ids."
|
We're closing this PR because it hasn't been updated in a while. This isn't a judgement on the merit of the PR in any way. It's just a way of keeping the PR queue manageable. |
Updated the documentation for the melt function as it requires the values argument, and it is not optional.
Proposed Changes
This pull request proposes updating the documentation to reflect that the values parameter in the .melt() method is required and not optional, as previously indicated. The documentation will now specify that values can be a str, Column, tuple, or list and must be explicitly provided.
Justification for Changes
The change is necessary because the current documentation incorrectly states that the values parameter is optional. This has led to confusion and runtime errors, as the parameter is actually required for the function to execute properly.
User-Facing Changes
This change affects the documentation only. It corrects the description of the values parameter from optional to required, providing clarity to users. This change will ensure users are aware that they need to specify the values parameter when using the .melt() method.
Testing of Changes
No new tests are required for this documentation update, as it does not affect the code's functionality. This update aims to clarify existing functionality and prevent user errors.
Use of Generative AI
No