Skip to content

Commit f10a6fe

Browse files
authored
pd.Index: replace set operations (#4568)
1 parent 5a60354 commit f10a6fe

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

doc/whats-new.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,9 @@ Internal Changes
107107
By `Mathias Hauser <https://github.com/mathause>`_.
108108
- Ensure tests are not skipped in the `py38-all-but-dask` test environment
109109
(:issue:`4509`). By `Mathias Hauser <https://github.com/mathause>`_.
110+
- Replace the internal use of ``pd.Index.__or__`` and ``pd.Index.__and__`` with ``pd.Index.union``
111+
and ``pd.Index.intersection`` as they will stop working as set operations in the future
112+
(:issue:`4565`). By `Mathias Hauser <https://github.com/mathause>`_.
110113

111114
.. _whats-new.0.16.1:
112115

xarray/core/alignment.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@
3232

3333
def _get_joiner(join):
3434
if join == "outer":
35-
return functools.partial(functools.reduce, operator.or_)
35+
return functools.partial(functools.reduce, pd.Index.union)
3636
elif join == "inner":
37-
return functools.partial(functools.reduce, operator.and_)
37+
return functools.partial(functools.reduce, pd.Index.intersection)
3838
elif join == "left":
3939
return operator.itemgetter(0)
4040
elif join == "right":

0 commit comments

Comments
 (0)