Skip to content

Commit 2ac6b5b

Browse files
Fix: Add additional filter warnings to the failing tests
1 parent d0ff888 commit 2ac6b5b

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

pandas/tests/groupby/test_groupby.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2851,6 +2851,9 @@ def test_groupby_with_Time_Grouper(unit):
28512851
tm.assert_frame_equal(result, expected_output)
28522852

28532853

2854+
@pytest.mark.filterwarnings(
2855+
"ignore:Parsing non-ISO datetime strings:pandas.errors.Pandas4Warning"
2856+
)
28542857
def test_groupby_series_with_datetimeindex_month_name():
28552858
# GH 48509
28562859
s = Series([0, 1, 0], index=date_range("2022-01-01", periods=3), name="jan")

pandas/tests/indexing/multiindex/test_slice.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,9 @@ def test_multiindex_slicers_datetimelike(self):
308308
]
309309
tm.assert_frame_equal(result, expected)
310310

311+
@pytest.mark.filterwarnings(
312+
"ignore:Parsing non-ISO datetime strings:pandas.errors.Pandas4Warning"
313+
)
311314
def test_multiindex_slicers_edges(self):
312315
# GH 8132
313316
# various edge cases

pandas/tests/indexing/test_loc.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,9 @@ def test_loc_empty_slice_assignment_with_datetime(self, data):
280280

281281
class TestLocBaseIndependent:
282282
# Tests for loc that do not depend on subclassing Base
283+
@pytest.mark.filterwarnings(
284+
"ignore:Parsing non-ISO datetime strings:pandas.errors.Pandas4Warning"
285+
)
283286
def test_loc_npstr(self):
284287
# GH#45580
285288
df = DataFrame(index=date_range("2021", "2022"))
@@ -1281,6 +1284,9 @@ def test_loc_setitem_str_to_small_float_conversion_type(self, using_infer_string
12811284
expected = DataFrame(col_data, columns=["A"], dtype=float)
12821285
tm.assert_frame_equal(result, expected)
12831286

1287+
@pytest.mark.filterwarnings(
1288+
"ignore:Parsing non-ISO datetime strings:pandas.errors.Pandas4Warning"
1289+
)
12841290
def test_loc_getitem_time_object(self, frame_or_series):
12851291
rng = date_range("1/1/2000", "1/5/2000", freq="5min")
12861292
mask = (rng.hour == 9) & (rng.minute == 30)
@@ -2434,6 +2440,9 @@ def test_loc_getitem_partial_slice_non_monotonicity(
24342440

24352441

24362442
class TestLabelSlicing:
2443+
@pytest.mark.filterwarnings(
2444+
"ignore:Parsing non-ISO datetime strings:pandas.errors.Pandas4Warning"
2445+
)
24372446
def test_loc_getitem_slicing_datetimes_frame(self):
24382447
# GH#7523
24392448

0 commit comments

Comments
 (0)