-
Notifications
You must be signed in to change notification settings - Fork 0
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
FEAT-#6498: Make Fold operator more flexible #54
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,6 +49,8 @@ def register( | |
def caller( | ||
query_compiler: PandasQueryCompiler, | ||
fold_axis: Optional[int] = None, | ||
new_index=None, | ||
new_columns=None, | ||
*args: tuple, | ||
**kwargs: dict, | ||
) -> PandasQueryCompiler: | ||
Comment on lines
49
to
56
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The new parameters
|
||
|
@@ -62,6 +64,10 @@ def caller( | |
fold_axis : int, optional | ||
0 or None means apply across full column partitions. 1 means | ||
apply across full row partitions. | ||
new_index : list-like, optional | ||
The index of the result. | ||
new_columns : list-like, optional | ||
The columns of the result. | ||
*args : tuple | ||
Additional arguments passed to `fold_function`. | ||
**kwargs: dict | ||
|
@@ -77,6 +83,8 @@ def caller( | |
query_compiler._modin_frame.fold( | ||
cls.validate_axis(fold_axis), | ||
lambda x: fold_function(x, *args, **kwargs), | ||
new_index=new_index, | ||
new_columns=new_columns, | ||
) | ||
) | ||
|
||
|
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.
Add validation for
new_index
andnew_columns
.Consider adding checks to ensure that
new_index
andnew_columns
are valid before passing them to thefold
method. This will prevent potential runtime errors.Add validation as follows: