Skip to content

pd.Index: replace set operations #4568

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
Nov 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions doc/whats-new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ Internal Changes
By `Mathias Hauser <https://github.com/mathause>`_.
- Ensure tests are not skipped in the `py38-all-but-dask` test environment
(:issue:`4509`). By `Mathias Hauser <https://github.com/mathause>`_.
- Replace the internal use of ``pd.Index.__or__`` and ``pd.Index.__and__`` with ``pd.Index.union``
and ``pd.Index.intersection`` as they will stop working as set operations in the future
(:issue:`4565`). By `Mathias Hauser <https://github.com/mathause>`_.

.. _whats-new.0.16.1:

Expand Down
4 changes: 2 additions & 2 deletions xarray/core/alignment.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@

def _get_joiner(join):
if join == "outer":
return functools.partial(functools.reduce, operator.or_)
return functools.partial(functools.reduce, pd.Index.union)
elif join == "inner":
return functools.partial(functools.reduce, operator.and_)
return functools.partial(functools.reduce, pd.Index.intersection)
elif join == "left":
return operator.itemgetter(0)
elif join == "right":
Expand Down