-
Notifications
You must be signed in to change notification settings - Fork 56
feat: Support args in series apply method #2013
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
base: main
Are you sure you want to change the base?
Conversation
func, | ||
by_row: typing.Union[typing.Literal["compat"], bool] = "compat", | ||
*, | ||
args: typing.Tuple = (), |
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.
In pandas args
can be a positional argument while by_row
is a keyword only argument https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.apply.html#pandas-series-apply. I would argue that we can adhere to that right now as I don't anticipate many people passing by_row
positional argument, but if not, we should add an item in BigFrames 3.0 to make the breaking change.
bf_result_col = scalars_df["int64_too"].apply( | ||
foo_list, args=(12.34, b"hello world", False) | ||
) | ||
bf_result = ( |
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.
wondering why we need to convert to put it in a DataFrame before asserting. Can't we compare bf_result_col
and pd_result_col
directly?
) | ||
|
||
# Ignore any dtype difference. | ||
pandas.testing.assert_frame_equal(bf_result, pd_result, check_dtype=False) |
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.
Same as the other comment, why not assert_series_equal
on the result of the apply
?
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
Fixes b/440342212.