Skip to content
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

CLN/DEPR: remove pd.ordered_merge #18459

Merged
merged 2 commits into from
Nov 24, 2017
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
1 change: 1 addition & 0 deletions doc/source/whatsnew/v0.22.0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ Removal of prior version deprecations/changes
- The ``levels`` and ``labels`` attributes of a ``MultiIndex`` can no longer be set directly (:issue:`4039`).
- ``pd.tseries.util.pivot_annual`` has been removed (deprecated since v0.19). Use ``pivot_table`` instead (:issue:`18370`)
- ``pd.tseries.util.isleapyear`` has been removed (deprecated since v0.19). Use ``.is_leap_year`` property in Datetime-likes instead (:issue:`18370`)
- ``pd.ordered_merge`` has been removed (deprecated since v0.19). Use ``pd..merge_ordered`` instead (:issue:`18459`)

.. _whatsnew_0220.performance:

Expand Down
3 changes: 1 addition & 2 deletions pandas/core/reshape/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from pandas.core.reshape.concat import concat
from pandas.core.reshape.melt import melt, lreshape, wide_to_long
from pandas.core.reshape.reshape import pivot_simple as pivot, get_dummies
from pandas.core.reshape.merge import (
merge, ordered_merge, merge_ordered, merge_asof)
from pandas.core.reshape.merge import merge, merge_ordered, merge_asof
from pandas.core.reshape.pivot import pivot_table, crosstab
from pandas.core.reshape.tile import cut, qcut
18 changes: 1 addition & 17 deletions pandas/core/reshape/merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,19 +139,6 @@ def _groupby_and_merge(by, on, left, right, _merge_pieces,
return result, lby


def ordered_merge(left, right, on=None,
left_on=None, right_on=None,
left_by=None, right_by=None,
fill_method=None, suffixes=('_x', '_y')):

warnings.warn("ordered_merge is deprecated and replaced by merge_ordered",
FutureWarning, stacklevel=2)
return merge_ordered(left, right, on=on,
left_on=left_on, right_on=right_on,
left_by=left_by, right_by=right_by,
fill_method=fill_method, suffixes=suffixes)


def merge_ordered(left, right, on=None,
left_on=None, right_on=None,
left_by=None, right_by=None,
Expand Down Expand Up @@ -204,7 +191,7 @@ def merge_ordered(left, right, on=None,
4 c 2 b
5 e 3 b

>>> ordered_merge(A, B, fill_method='ffill', left_by='group')
>>> merge_ordered(A, B, fill_method='ffill', left_by='group')
key lvalue group rvalue
0 a 1 a NaN
1 b 1 a 1
Expand Down Expand Up @@ -253,9 +240,6 @@ def _merger(x, y):
return result


ordered_merge.__doc__ = merge_ordered.__doc__


def merge_asof(left, right, on=None,
left_on=None, right_on=None,
left_index=False, right_index=False,
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/api/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class TestPDApi(Base):
'rolling_kurt', 'rolling_max', 'rolling_mean',
'rolling_median', 'rolling_min', 'rolling_quantile',
'rolling_skew', 'rolling_std', 'rolling_sum',
'rolling_var', 'rolling_window', 'ordered_merge',
'rolling_var', 'rolling_window',
'pnow', 'match', 'groupby', 'get_store',
'plot_params', 'scatter_matrix']

Expand Down
9 changes: 1 addition & 8 deletions pandas/tests/reshape/test_merge_ordered.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from numpy import nan


class TestOrderedMerge(object):
class TestMergeOrdered(object):

def setup_method(self, method):
self.left = DataFrame({'key': ['a', 'c', 'e'],
Expand All @@ -15,13 +15,6 @@ def setup_method(self, method):
self.right = DataFrame({'key': ['b', 'c', 'd', 'f'],
'rvalue': [1, 2, 3., 4]})

def test_deprecation(self):

with tm.assert_produces_warning(FutureWarning):
pd.ordered_merge(self.left, self.right, on='key')

# GH #813

def test_basic(self):
result = merge_ordered(self.left, self.right, on='key')
expected = DataFrame({'key': ['a', 'b', 'c', 'd', 'e', 'f'],
Expand Down