-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
DEPR: allowing unknown array-likes in merge #48454
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
Changes from all commits
4bf8638
55ad044
92b3ed3
136088c
bb50e6f
3ae0d5d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,8 @@ | |
import numpy as np | ||
import pytest | ||
|
||
import pandas.util._test_decorators as td | ||
|
||
from pandas.core.dtypes.common import ( | ||
is_categorical_dtype, | ||
is_object_dtype, | ||
|
@@ -2720,6 +2722,25 @@ def test_merge_different_index_names(): | |
tm.assert_frame_equal(result, expected) | ||
|
||
|
||
@td.skip_if_no("dask") | ||
def test_merge_on_arraylike_deprecation(): | ||
# deprecate allowing non-standard array-likes for "on" | ||
|
||
left = DataFrame({"A": range(3), "B": range(1, 4)}) | ||
right = DataFrame({"C": range(2, 5)}) | ||
|
||
import dask.array | ||
|
||
arr = dask.array.array([0, 1, 2]) # matches left["A"] | ||
|
||
msg = "will only allow array-like objects that are one of the following types" | ||
with tm.assert_produces_warning(FutureWarning, match=msg): | ||
res = merge(left, right, left_on="A", right_on=arr) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you also add tests that the FutureWarning shows up when the dask array is passed to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. huh this now raises for me locally; i wonder if it isnt getting run on the CI? ive gotta run, will dig into this later |
||
|
||
expected = merge(left, right, left_on="A", right_on=np.array(arr)) | ||
tm.assert_frame_equal(res, expected) | ||
|
||
|
||
def test_merge_ea(any_numeric_ea_dtype, join_type): | ||
# GH#44240 | ||
left = DataFrame({"a": [1, 2, 3], "b": 1}, dtype=any_numeric_ea_dtype) | ||
|
Uh oh!
There was an error while loading. Please reload this page.