Skip to content
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
20 changes: 14 additions & 6 deletions tests/test_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -2670,12 +2670,20 @@ def test_frame_reindex_like() -> None:
# GH 84
df = pd.DataFrame({"a": [1, 2, 3]}, index=[0, 1, 2])
other = pd.DataFrame({"a": [1, 2]}, index=[1, 0])
check(
assert_type(
df.reindex_like(other, method="nearest", tolerance=[0.5, 0.2]), pd.DataFrame
),
pd.DataFrame,
)

with pytest_warns_bounded(
FutureWarning,
"the 'method' keyword is deprecated and will be removed in a future version. Please take steps to stop the use of 'method'",
lower="2.2.99",
upper="3.0.99",
):
check(
assert_type(
df.reindex_like(other, method="nearest", tolerance=[0.5, 0.2]),
pd.DataFrame,
),
pd.DataFrame,
)


def test_frame_ndarray_assignmment() -> None:
Expand Down
22 changes: 14 additions & 8 deletions tests/test_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -3574,14 +3574,20 @@ def test_series_reindex() -> None:
def test_series_reindex_like() -> None:
s = pd.Series([1, 2, 3], index=[0, 1, 2])
other = pd.Series([1, 2], index=[1, 0])
check(
assert_type(
s.reindex_like(other, method="nearest", tolerance=[0.5, 0.2]),
"pd.Series[int]",
),
pd.Series,
np.integer,
)
with pytest_warns_bounded(
FutureWarning,
"the 'method' keyword is deprecated and will be removed in a future version. Please take steps to stop the use of 'method'",
lower="2.2.99",
upper="3.0.99",
):
check(
assert_type(
s.reindex_like(other, method="nearest", tolerance=[0.5, 0.2]),
"pd.Series[int]",
),
pd.Series,
np.integer,
)


def test_info() -> None:
Expand Down