Skip to content

Commit 4bae53c

Browse files
authored
Remove ignores due to pandas-stubs (#9329)
* Update test_conventions.py * more
1 parent 2580a9f commit 4bae53c

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

xarray/tests/test_backends.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ def test_roundtrip_cftime_datetime_data(self) -> None:
568568
assert actual.t.encoding["calendar"] == expected_calendar
569569

570570
def test_roundtrip_timedelta_data(self) -> None:
571-
time_deltas = pd.to_timedelta(["1h", "2h", "NaT"]) # type: ignore[arg-type] #https://github.com/pandas-dev/pandas-stubs/issues/956
571+
time_deltas = pd.to_timedelta(["1h", "2h", "NaT"])
572572
expected = Dataset({"td": ("td", time_deltas), "td0": time_deltas[0]})
573573
with self.roundtrip(expected) as actual:
574574
assert_identical(expected, actual)

xarray/tests/test_coding_times.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -628,10 +628,10 @@ def test_cf_timedelta_2d() -> None:
628628
@pytest.mark.parametrize(
629629
["deltas", "expected"],
630630
[
631-
(pd.to_timedelta(["1 day", "2 days"]), "days"), # type: ignore[arg-type] #https://github.com/pandas-dev/pandas-stubs/issues/956
632-
(pd.to_timedelta(["1h", "1 day 1 hour"]), "hours"), # type: ignore[arg-type] #https://github.com/pandas-dev/pandas-stubs/issues/956
633-
(pd.to_timedelta(["1m", "2m", np.nan]), "minutes"), # type: ignore[arg-type] #https://github.com/pandas-dev/pandas-stubs/issues/956
634-
(pd.to_timedelta(["1m3s", "1m4s"]), "seconds"), # type: ignore[arg-type] #https://github.com/pandas-dev/pandas-stubs/issues/956
631+
(pd.to_timedelta(["1 day", "2 days"]), "days"),
632+
(pd.to_timedelta(["1h", "1 day 1 hour"]), "hours"),
633+
(pd.to_timedelta(["1m", "2m", np.nan]), "minutes"),
634+
(pd.to_timedelta(["1m3s", "1m4s"]), "seconds"),
635635
],
636636
)
637637
def test_infer_timedelta_units(deltas, expected) -> None:

xarray/tests/test_conventions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def test_incompatible_attributes(self) -> None:
119119
Variable(
120120
["t"], pd.date_range("2000-01-01", periods=3), {"units": "foobar"}
121121
),
122-
Variable(["t"], pd.to_timedelta(["1 day"]), {"units": "foobar"}), # type: ignore[arg-type] #https://github.com/pandas-dev/pandas-stubs/issues/956
122+
Variable(["t"], pd.to_timedelta(["1 day"]), {"units": "foobar"}),
123123
Variable(["t"], [0, 1, 2], {"add_offset": 0}, {"add_offset": 2}),
124124
Variable(["t"], [0, 1, 2], {"_FillValue": 0}, {"_FillValue": 2}),
125125
]

xarray/tests/test_formatting.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,9 @@ def test_format_items(self) -> None:
118118
np.arange(4) * np.timedelta64(500, "ms"),
119119
"00:00:00 00:00:00.500000 00:00:01 00:00:01.500000",
120120
),
121-
(pd.to_timedelta(["NaT", "0s", "1s", "NaT"]), "NaT 00:00:00 00:00:01 NaT"), # type: ignore[arg-type] #https://github.com/pandas-dev/pandas-stubs/issues/956
121+
(pd.to_timedelta(["NaT", "0s", "1s", "NaT"]), "NaT 00:00:00 00:00:01 NaT"),
122122
(
123-
pd.to_timedelta(["1 day 1 hour", "1 day", "0 hours"]), # type: ignore[arg-type] #https://github.com/pandas-dev/pandas-stubs/issues/956
123+
pd.to_timedelta(["1 day 1 hour", "1 day", "0 hours"]),
124124
"1 days 01:00:00 1 days 00:00:00 0 days 00:00:00",
125125
),
126126
([1, 2, 3], "1 2 3"),

0 commit comments

Comments
 (0)