Skip to content

REF: use dispatch_to_extension_op for bool ops #27959

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

Merged
merged 2 commits into from
Sep 2, 2019

Conversation

jbrockmendel
Copy link
Member

Along with #27912 this completes the process of doing this for all Series ops. From there we can move the array-specific components to array_ops and define the PandasArray ops appropriately.

elif should_extension_dispatch(self, other):
# e.g. SparseArray
res_values = dispatch_to_extension_op(op, self, other)
return _construct_result(self, res_values, index=self.index, name=res_name)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is res_values always an array, or can it be a tuple of results, like from divmod?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in this context its always an array

@jbrockmendel
Copy link
Member Author

on another branch im finding this is necessary for IntegerNA bitwise ops to behave correctly

@jreback jreback added the ExtensionArray Extending pandas with custom dtypes or arrays. label Sep 2, 2019
@jreback jreback added this to the 1.0 milestone Sep 2, 2019
@jreback jreback merged commit 89e5f84 into pandas-dev:master Sep 2, 2019
@jreback
Copy link
Contributor

jreback commented Sep 2, 2019

thanks @jbrockmendel

@simonjayhawkins
Copy link
Member

This is failing on master and locally.

https://travis-ci.org/pandas-dev/pandas/builds/579982907?utm_source=github_status&utm_medium=notification

=================================== FAILURES ===================================
________________ pandas/tests/arrays/sparse/test_arithmetics.py ________________
[gw0] linux -- Python 3.6.6 /home/travis/miniconda3/envs/pandas-dev/bin/python
worker 'gw0' crashed while running 'pandas/tests/arrays/sparse/test_arithmetics.py::TestSparseSeriesArithmetic::test_bool_same_index[integer-False]'
________________ pandas/tests/arrays/sparse/test_arithmetics.py ________________
[gw1] linux -- Python 3.6.6 /home/travis/miniconda3/envs/pandas-dev/bin/python
worker 'gw1' crashed while running 'pandas/tests/arrays/sparse/test_arithmetics.py::TestSparseSeriesArithmetic::test_bool_same_index[integer-True]'
________________ pandas/tests/arrays/sparse/test_arithmetics.py ________________
[gw3] linux -- Python 3.6.6 /home/travis/miniconda3/envs/pandas-dev/bin/python
worker 'gw3' crashed while running 'pandas/tests/arrays/sparse/test_arithmetics.py::TestSparseSeriesArithmetic::test_bool_same_index[block-True]'
________________ pandas/tests/arrays/sparse/test_arithmetics.py ________________
[gw4] linux -- Python 3.6.6 /home/travis/miniconda3/envs/pandas-dev/bin/python
worker 'gw4' crashed while running 'pandas/tests/arrays/sparse/test_arithmetics.py::TestSparseSeriesArithmetic::test_bool_same_index[integer-nan]'
________________ pandas/tests/arrays/sparse/test_arithmetics.py ________________
[gw5] linux -- Python 3.6.6 /home/travis/miniconda3/envs/pandas-dev/bin/python
worker 'gw5' crashed while running 'pandas/tests/arrays/sparse/test_arithmetics.py::TestSparseSeriesArithmetic::test_bool_same_index[block-nan]'
________________ pandas/tests/arrays/sparse/test_arithmetics.py ________________
[gw6] linux -- Python 3.6.6 /home/travis/miniconda3/envs/pandas-dev/bin/python
worker 'gw6' crashed while running 'pandas/tests/arrays/sparse/test_arithmetics.py::TestSparseSeriesArithmetic::test_bool_same_index[block-False]'
________________ pandas/tests/arrays/sparse/test_arithmetics.py ________________
[gw7] linux -- Python 3.6.6 /home/travis/miniconda3/envs/pandas-dev/bin/python
worker 'gw7' crashed while running 'pandas/tests/arrays/sparse/test_arithmetics.py::TestSparseSeriesArithmetic::test_bool_array_logical[integer-False]'
________________ pandas/tests/arrays/sparse/test_arithmetics.py ________________
[gw2] linux -- Python 3.6.6 /home/travis/miniconda3/envs/pandas-dev/bin/python
worker 'gw2' crashed while running 'pandas/tests/arrays/sparse/test_arithmetics.py::TestSparseSeriesArithmetic::test_bool_array_logical[integer-True]'
________________ pandas/tests/arrays/sparse/test_arithmetics.py ________________
[gw8] linux -- Python 3.6.6 /home/travis/miniconda3/envs/pandas-dev/bin/python
worker 'gw8' crashed while running 'pandas/tests/arrays/sparse/test_arithmetics.py::TestSparseSeriesArithmetic::test_bool_array_logical[integer-nan]'
________________ pandas/tests/arrays/sparse/test_arithmetics.py ________________
[gw9] linux -- Python 3.6.6 /home/travis/miniconda3/envs/pandas-dev/bin/python
worker 'gw9' crashed while running 'pandas/tests/arrays/sparse/test_arithmetics.py::TestSparseSeriesArithmetic::test_bool_array_logical[block-True]'

@jbrockmendel
Copy link
Member Author

Yah, looks like this should be reverted for the time being

jbrockmendel added a commit to jbrockmendel/pandas that referenced this pull request Sep 2, 2019
WillAyd pushed a commit that referenced this pull request Sep 3, 2019
jbrockmendel added a commit to jbrockmendel/pandas that referenced this pull request Sep 3, 2019
@jbrockmendel jbrockmendel deleted the mops2 branch September 3, 2019 01:50
MarcoGorelli pushed a commit to MarcoGorelli/pandas that referenced this pull request Sep 3, 2019
TomAugspurger pushed a commit that referenced this pull request Sep 3, 2019
re-implement #27959, which was previously merged and reverted.
proost pushed a commit to proost/pandas that referenced this pull request Dec 19, 2019
proost pushed a commit to proost/pandas that referenced this pull request Dec 19, 2019
proost pushed a commit to proost/pandas that referenced this pull request Dec 19, 2019
re-implement pandas-dev#27959, which was previously merged and reverted.
proost pushed a commit to proost/pandas that referenced this pull request Dec 19, 2019
proost pushed a commit to proost/pandas that referenced this pull request Dec 19, 2019
proost pushed a commit to proost/pandas that referenced this pull request Dec 19, 2019
re-implement pandas-dev#27959, which was previously merged and reverted.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ExtensionArray Extending pandas with custom dtypes or arrays.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants