Skip to content

Commit 2712fd7

Browse files
committed
Deprecated tests
1 parent 7522828 commit 2712fd7

File tree

4 files changed

+1
-48
lines changed

4 files changed

+1
-48
lines changed

pandas/core/indexes/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
no_default,
4040
)
4141
from pandas._libs.tslibs import (
42-
OutOfBoundsDatetime,
4342
Timestamp,
4443
tz_compare,
4544
)
@@ -6228,6 +6227,7 @@ def _maybe_downcast_for_indexing(self, other: Index) -> tuple[Index, Index]:
62286227
if not is_object_dtype(self.dtype) and is_object_dtype(other.dtype):
62296228
# Reverse op so we dont need to re-implement on the subclasses
62306229
other, self = other._maybe_downcast_for_indexing(self)
6230+
62316231
return self, other
62326232

62336233
@final

pandas/tests/frame/methods/test_asfreq.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -185,17 +185,6 @@ def test_asfreq_fillvalue(self):
185185
actual_series = ts.asfreq(freq="1s", fill_value=9.0)
186186
tm.assert_series_equal(expected_series, actual_series)
187187

188-
def test_asfreq_with_date_object_index(self, frame_or_series):
189-
rng = date_range("1/1/2000", periods=20)
190-
ts = frame_or_series(np.random.default_rng(2).standard_normal(20), index=rng)
191-
192-
ts2 = ts.copy()
193-
ts2.index = [x.date() for x in ts2.index]
194-
195-
result = ts2.asfreq("4h", method="ffill")
196-
expected = ts.asfreq("4h", method="ffill")
197-
tm.assert_equal(result, expected)
198-
199188
def test_asfreq_with_unsorted_index(self, frame_or_series):
200189
# GH#39805
201190
# Test that rows are not dropped when the datetime index is out of order

pandas/tests/indexes/datetimes/test_indexing.py

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -513,13 +513,6 @@ def test_contains_nonunique(self, vals):
513513

514514

515515
class TestGetIndexer:
516-
def test_get_indexer_date_objs(self):
517-
rng = date_range("1/1/2000", periods=20)
518-
519-
result = rng.get_indexer(rng.map(lambda x: x.date()))
520-
expected = rng.get_indexer(rng)
521-
tm.assert_numpy_array_equal(result, expected)
522-
523516
def test_get_indexer(self):
524517
idx = date_range("2000-01-01", periods=3)
525518
exp = np.array([0, 1, 2], dtype=np.intp)
@@ -561,20 +554,6 @@ def test_get_indexer(self):
561554
with pytest.raises(ValueError, match="abbreviation w/o a number"):
562555
idx.get_indexer(idx[[0]], method="nearest", tolerance="foo")
563556

564-
@pytest.mark.parametrize(
565-
"target",
566-
[
567-
[date(2020, 1, 1), Timestamp("2020-01-02")],
568-
[Timestamp("2020-01-01"), date(2020, 1, 2)],
569-
],
570-
)
571-
def test_get_indexer_mixed_dtypes(self, target):
572-
# https://github.com/pandas-dev/pandas/issues/33741
573-
values = DatetimeIndex([Timestamp("2020-01-01"), Timestamp("2020-01-02")])
574-
result = values.get_indexer(target)
575-
expected = np.array([0, 1], dtype=np.intp)
576-
tm.assert_numpy_array_equal(result, expected)
577-
578557
@pytest.mark.parametrize(
579558
"target, positions",
580559
[

pandas/tests/series/test_arithmetic.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -757,21 +757,6 @@ def test_datetime_understood(self, unit):
757757
expected = Series(exp_dti)
758758
tm.assert_series_equal(result, expected)
759759

760-
def test_align_date_objects_with_datetimeindex(self):
761-
rng = date_range("1/1/2000", periods=20)
762-
ts = Series(np.random.default_rng(2).standard_normal(20), index=rng)
763-
764-
ts_slice = ts[5:]
765-
ts2 = ts_slice.copy()
766-
ts2.index = [x.date() for x in ts2.index]
767-
768-
result = ts + ts2
769-
result2 = ts2 + ts
770-
expected = ts + ts[5:]
771-
expected.index = expected.index._with_freq(None)
772-
tm.assert_series_equal(result, expected)
773-
tm.assert_series_equal(result2, expected)
774-
775760

776761
class TestNamePreservation:
777762
@pytest.mark.parametrize("box", [list, tuple, np.array, Index, Series, pd.array])

0 commit comments

Comments
 (0)