Skip to content

BUG: Fixed DataFrameGroupBy.transform with numba returning the wrong order with non increasing indexes #57069 #58030

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

Conversation

andremcorreia
Copy link
Contributor

DataFrameGroupBy.transform with numba was returning the wrong order unless the index was monotonically increasing due to the transformed results not being correctly reordered.
Fixed the test "pandas/tests/groupby/transform/test_numba.py::test_index_data_correctly_passed" to expect the correct order in the result.
Added a test "pandas/tests/groupby/transform/test_numba.py::test_index_order_consistency_preserved" to test DataFrameGroupBy.transform with engine='numba' with a decreasing index.

… the wrong order with non monotonically increasing indexes

Fixed a bug that was returning the wrong order unless the index was monotonically increasing while utilizing DataFrameGroupBy.transform with engine='numba'
Fixed the test "pandas/tests/groupby/transform/test_numba.py::test_index_data_correctly_passed" to expect a result in the correct order
Added a test "pandas/tests/groupby/transform/test_numba.py::test_index_order_consistency_preserved" to test DataFrameGroupBy.transform with engine='numba' with a decreasing index
Updated whatsnew to reflect changes
@mroeschke mroeschke added Apply Apply, Aggregate, Transform, Map numba numba-accelerated operations labels Mar 27, 2024
@andremcorreia andremcorreia requested a review from mroeschke March 28, 2024 22:11
@mroeschke mroeschke added this to the 3.0 milestone Mar 28, 2024
@mroeschke mroeschke merged commit c468028 into pandas-dev:main Mar 28, 2024
46 checks passed
@mroeschke
Copy link
Member

Thanks @andremcorreia

pmhatre1 pushed a commit to pmhatre1/pandas-pmhatre1 that referenced this pull request May 7, 2024
…order with non increasing indexes pandas-dev#57069 (pandas-dev#58030)

* Fix pandas-dev#57069: DataFrameGroupBy.transform with numba returning the wrong order with non monotonically increasing indexes

Fixed a bug that was returning the wrong order unless the index was monotonically increasing while utilizing DataFrameGroupBy.transform with engine='numba'
Fixed the test "pandas/tests/groupby/transform/test_numba.py::test_index_data_correctly_passed" to expect a result in the correct order
Added a test "pandas/tests/groupby/transform/test_numba.py::test_index_order_consistency_preserved" to test DataFrameGroupBy.transform with engine='numba' with a decreasing index
Updated whatsnew to reflect changes

* Apply suggestions from code review

Co-authored-by: Matthew Roeschke <[email protected]>

* Fixed pre-commit requirements

---------

Co-authored-by: Matthew Roeschke <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Apply Apply, Aggregate, Transform, Map numba numba-accelerated operations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: DataFrameGroupBy.transform with engine='numba' reorder output by index
2 participants