-
-
Notifications
You must be signed in to change notification settings - Fork 18k
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
REGR: 1.3 behavior change with groupby, apply and side effect #41999
Comments
mutating groupby is clearly called out in the docs - |
if you add
|
Yah im pretty sure this is due to the block.values pinning we do in libreduction, which in this case leads to the size of the data in the DataFrame to not match the length of the columns. If there's an outcry, reverting #38285 wouldn't be the end of the world. But mutating within groupby apply is a constant headache and the only real solution is to not allow it. |
I'll label as regression and milestone as 1.3 and assume we will revert #38285 for 1.3 and disallow mutation in a future version. |
-1 on reverting - this is not supported in any way and noted in the docs we could have a better error message though |
sure. if we can do for 1.3 and add something to the api breaking changes of the release notes, otherwise I see no harm in reverting #38285 to keep the api stable for users. |
Agreed mutating should not be supported after 1.3, but it is not in the public docs until 1.3 is released. With this in mind, we could revert #38285 for 1.3 and reinstating it for the next release. That said, I'm +1 on leaving as-is. |
changing milestone to 1.3.5 |
This no longer raises on master and produces the output
which looks correct to me. As mutation is not supported, I don't believe tests should be added and that this issue can be closed. |
Because that PR made other behavioral changes #43206 (comment), we should probably rule out backporting in order to close this issue.
will close but without a test this issue could potentially resurface, depending on fix to #43206 |
Code Sample, a copy-pastable example
Problem description
Deleting the row passed to
apply_func
in combination with the call tohead
causes an exception in 1.3rc1.When
apply_func
is called the second time theMEMBER_ID
column does not exist anymore.Doing a
df = df.copy()
inapply_func
fixes the problem.Expected Output
While one could argue that the code is a bit bogus (and should be possibly rewritten), I wonder if this change happened on purpose.
The text was updated successfully, but these errors were encountered: