Skip to content

Commit

Permalink
Remove deprecated method parameter from merge and join. (#9944)
Browse files Browse the repository at this point in the history
This PR removes the deprecated `method` parameter from `DataFrame.merge` and `DataFrame.join`. This resolves #9353 and follows up on #9291.

Authors:
  - Bradley Dice (https://github.com/bdice)

Approvers:
  - GALI PREM SAGAR (https://github.com/galipremsagar)

URL: #9944
  • Loading branch information
bdice authored Jan 13, 2022
1 parent 3176258 commit 4950a7a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 31 deletions.
30 changes: 1 addition & 29 deletions python/cudf/cudf/core/dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -3438,7 +3438,6 @@ def merge(
sort=False,
lsuffix=None,
rsuffix=None,
method=None,
indicator=False,
suffixes=("_x", "_y"),
):
Expand Down Expand Up @@ -3490,9 +3489,6 @@ def merge(
suffixes: Tuple[str, str], defaults to ('_x', '_y')
Suffixes applied to overlapping column names on the left and right
sides
method :
This parameter is unused. It is deprecated and will be removed in a
future version.
Returns
-------
Expand Down Expand Up @@ -3554,13 +3550,6 @@ def merge(
else:
lsuffix, rsuffix = suffixes

if method is not None:
warnings.warn(
"The 'method' argument is deprecated and will be removed "
"in a future version of cudf.",
FutureWarning,
)

# Compute merge
gdf_result = super()._merge(
right,
Expand All @@ -3578,14 +3567,7 @@ def merge(

@annotate("JOIN", color="blue", domain="cudf_python")
def join(
self,
other,
on=None,
how="left",
lsuffix="",
rsuffix="",
sort=False,
method=None,
self, other, on=None, how="left", lsuffix="", rsuffix="", sort=False,
):
"""Join columns with other DataFrame on index or on a key column.
Expand All @@ -3599,9 +3581,6 @@ def join(
column names when avoiding conflicts.
sort : bool
Set to True to ensure sorted ordering.
method :
This parameter is unused. It is deprecated and will be removed in a
future version.
Returns
-------
Expand All @@ -3615,13 +3594,6 @@ def join(
- *on* is not supported yet due to lack of multi-index support.
"""

if method is not None:
warnings.warn(
"The 'method' argument is deprecated and will be removed "
"in a future version of cudf.",
FutureWarning,
)

df = self.merge(
other,
left_index=True,
Expand Down
4 changes: 2 additions & 2 deletions python/cudf/cudf/tests/test_joining.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ def test_dataframe_join_mismatch_cats(how):

pdf1 = pdf1.set_index("join_col")
pdf2 = pdf2.set_index("join_col")
join_gdf = gdf1.join(gdf2, how=how, sort=True, method="hash")
join_gdf = gdf1.join(gdf2, how=how, sort=True)
join_pdf = pdf1.join(pdf2, how=how)

got = join_gdf.fillna(-1).to_pandas()
Expand Down Expand Up @@ -403,7 +403,7 @@ def test_dataframe_merge_order():
gdf2["id"] = [4, 5]
gdf2["a"] = [7, 8]

gdf = gdf1.merge(gdf2, how="left", on=["id", "a"], method="hash")
gdf = gdf1.merge(gdf2, how="left", on=["id", "a"])

df1 = pd.DataFrame()
df2 = pd.DataFrame()
Expand Down

0 comments on commit 4950a7a

Please sign in to comment.