Skip to content

Commit aa26f23

Browse files
simonjayhawkinsluckyvs1
authored andcommitted
TYP: remove ignores from pandas/_testing/__init__.py (pandas-dev#39052)
1 parent 6967fd3 commit aa26f23

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed

pandas/_testing/__init__.py

+4-12
Original file line numberDiff line numberDiff line change
@@ -136,24 +136,16 @@ def set_testing_mode():
136136
# set the testing mode filters
137137
testing_mode = os.environ.get("PANDAS_TESTING_MODE", "None")
138138
if "deprecate" in testing_mode:
139-
# pandas\_testing.py:119: error: Argument 2 to "simplefilter" has
140-
# incompatible type "Tuple[Type[DeprecationWarning],
141-
# Type[ResourceWarning]]"; expected "Type[Warning]"
142-
warnings.simplefilter(
143-
"always", _testing_mode_warnings # type: ignore[arg-type]
144-
)
139+
for category in _testing_mode_warnings:
140+
warnings.simplefilter("always", category)
145141

146142

147143
def reset_testing_mode():
148144
# reset the testing mode filters
149145
testing_mode = os.environ.get("PANDAS_TESTING_MODE", "None")
150146
if "deprecate" in testing_mode:
151-
# pandas\_testing.py:126: error: Argument 2 to "simplefilter" has
152-
# incompatible type "Tuple[Type[DeprecationWarning],
153-
# Type[ResourceWarning]]"; expected "Type[Warning]"
154-
warnings.simplefilter(
155-
"ignore", _testing_mode_warnings # type: ignore[arg-type]
156-
)
147+
for category in _testing_mode_warnings:
148+
warnings.simplefilter("ignore", category)
157149

158150

159151
set_testing_mode()

pandas/core/indexes/period.py

+3
Original file line numberDiff line numberDiff line change
@@ -164,18 +164,21 @@ def to_timestamp(self, freq=None, how="start") -> DatetimeIndex:
164164
arr = self._data.to_timestamp(freq, how)
165165
return DatetimeIndex._simple_new(arr, name=self.name)
166166

167+
# https://github.com/python/mypy/issues/1362
167168
# error: Decorated property not supported [misc]
168169
@property # type:ignore[misc]
169170
@doc(PeriodArray.hour.fget)
170171
def hour(self) -> Int64Index:
171172
return Int64Index(self._data.hour, name=self.name)
172173

174+
# https://github.com/python/mypy/issues/1362
173175
# error: Decorated property not supported [misc]
174176
@property # type:ignore[misc]
175177
@doc(PeriodArray.minute.fget)
176178
def minute(self) -> Int64Index:
177179
return Int64Index(self._data.minute, name=self.name)
178180

181+
# https://github.com/python/mypy/issues/1362
179182
# error: Decorated property not supported [misc]
180183
@property # type:ignore[misc]
181184
@doc(PeriodArray.second.fget)

0 commit comments

Comments
 (0)