Skip to content

Commit cb2eb54

Browse files
committed
fix & ignore failures
1 parent 936fe66 commit cb2eb54

File tree

22 files changed

+37
-37
lines changed

22 files changed

+37
-37
lines changed

pandas/core/apply.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -246,12 +246,8 @@ def transform(self) -> DataFrame | Series:
246246
and not obj.empty
247247
):
248248
raise ValueError("Transform function failed")
249-
# error: Argument 1 to "__get__" of "AxisProperty" has incompatible type
250-
# "Union[Series, DataFrame, GroupBy[Any], SeriesGroupBy,
251-
# DataFrameGroupBy, BaseWindow, Resampler]"; expected "Union[DataFrame,
252-
# Series]"
253249
if not isinstance(result, (ABCSeries, ABCDataFrame)) or not result.index.equals(
254-
obj.index # type: ignore[arg-type]
250+
obj.index
255251
):
256252
raise ValueError("Function did not transform")
257253

pandas/core/arraylike.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,12 +403,12 @@ def _reconstruct(result):
403403
# for np.<ufunc>(..) calls
404404
# kwargs cannot necessarily be handled block-by-block, so only
405405
# take this path if there are no kwargs
406-
mgr = inputs[0]._mgr
406+
mgr = inputs[0]._mgr # pyright: ignore[reportGeneralTypeIssues]
407407
result = mgr.apply(getattr(ufunc, method))
408408
else:
409409
# otherwise specific ufunc methods (eg np.<ufunc>.accumulate(..))
410410
# Those can have an axis keyword and thus can't be called block-by-block
411-
result = default_array_ufunc(inputs[0], ufunc, method, *inputs, **kwargs)
411+
result = default_array_ufunc(inputs[0], ufunc, method, *inputs, **kwargs) # pyright: ignore[reportGeneralTypeIssues]
412412
# e.g. np.negative (only one reached), with "where" and "out" in kwargs
413413

414414
result = reconstruct(result)

pandas/core/arrays/arrow/array.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2426,7 +2426,7 @@ def _str_rindex(self, sub: str, start: int = 0, end: int | None = None) -> Self:
24262426
result = self._apply_elementwise(predicate)
24272427
return type(self)(pa.chunked_array(result))
24282428

2429-
def _str_normalize(self, form: str) -> Self:
2429+
def _str_normalize(self, form: Literal["NFC", "NFD", "NFKC", "NFKD"]) -> Self:
24302430
predicate = lambda val: unicodedata.normalize(form, val)
24312431
result = self._apply_elementwise(predicate)
24322432
return type(self)(pa.chunked_array(result))

pandas/core/arrays/boolean.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ def _coerce_to_array(
369369
assert dtype == "boolean"
370370
return coerce_to_array(value, copy=copy)
371371

372-
def _logical_method(self, other, op):
372+
def _logical_method(self, other, op): # type: ignore[override]
373373
assert op.__name__ in {"or_", "ror_", "and_", "rand_", "xor", "rxor"}
374374
other_is_scalar = lib.is_scalar(other)
375375
mask = None

pandas/core/computation/expr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ def _preparse(
168168
the ``tokenize`` module and ``tokval`` is a string.
169169
"""
170170
assert callable(f), "f must be callable"
171-
return tokenize.untokenize(f(x) for x in tokenize_string(source))
171+
return tokenize.untokenize(f(x) for x in tokenize_string(source)) # pyright: ignore[reportArgumentType]
172172

173173

174174
def _is_type(t):

pandas/core/frame.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2306,7 +2306,7 @@ def maybe_reorder(
23062306

23072307
if any(exclude):
23082308
arr_exclude = (x for x in exclude if x in arr_columns)
2309-
to_remove = {arr_columns.get_loc(col) for col in arr_exclude}
2309+
to_remove = {arr_columns.get_loc(col) for col in arr_exclude} # pyright: ignore[reportUnhashable]
23102310
arrays = [v for i, v in enumerate(arrays) if i not in to_remove]
23112311

23122312
columns = columns.drop(exclude)

pandas/core/groupby/groupby.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3719,7 +3719,7 @@ def blk_func(values: ArrayLike) -> ArrayLike:
37193719
mask = isna(values)
37203720
if values.ndim == 1:
37213721
indexer = np.empty(values.shape, dtype=np.intp)
3722-
col_func(out=indexer, mask=mask)
3722+
col_func(out=indexer, mask=mask) # type: ignore[arg-type]
37233723
return algorithms.take_nd(values, indexer)
37243724

37253725
else:
@@ -4081,7 +4081,9 @@ def _nth(
40814081
def quantile(
40824082
self,
40834083
q: float | AnyArrayLike = 0.5,
4084-
interpolation: str = "linear",
4084+
interpolation: Literal[
4085+
"linear", "lower", "higher", "nearest", "midpoint"
4086+
] = "linear",
40854087
numeric_only: bool = False,
40864088
):
40874089
"""
@@ -4270,7 +4272,7 @@ def blk_func(values: ArrayLike) -> ArrayLike:
42704272
func(
42714273
out[0],
42724274
values=vals,
4273-
mask=mask,
4275+
mask=mask, # type: ignore[arg-type]
42744276
result_mask=result_mask,
42754277
is_datetimelike=is_datetimelike,
42764278
)

pandas/core/indexes/interval.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -991,7 +991,7 @@ def length(self) -> Index:
991991
# --------------------------------------------------------------------
992992
# Set Operations
993993

994-
def _intersection(self, other, sort):
994+
def _intersection(self, other, sort: bool = False):
995995
"""
996996
intersection specialized to the case with matching dtypes.
997997
"""
@@ -1006,7 +1006,7 @@ def _intersection(self, other, sort):
10061006
# duplicates
10071007
taken = self._intersection_non_unique(other)
10081008

1009-
if sort is None:
1009+
if sort:
10101010
taken = taken.sort_values()
10111011

10121012
return taken

pandas/core/resample.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ def transform(self, arg, *args, **kwargs):
404404
arg, *args, **kwargs
405405
)
406406

407-
def _downsample(self, f, **kwargs):
407+
def _downsample(self, how, **kwargs):
408408
raise AbstractMethodError(self)
409409

410410
def _upsample(self, f, limit: int | None = None, fill_value=None):

pandas/core/series.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -813,8 +813,7 @@ def _values(self):
813813
def _references(self) -> BlockValuesRefs:
814814
return self._mgr._block.refs
815815

816-
# error: Decorated property not supported
817-
@Appender(base.IndexOpsMixin.array.__doc__) # type: ignore[misc]
816+
@Appender(base.IndexOpsMixin.array.__doc__)
818817
@property
819818
def array(self) -> ExtensionArray:
820819
return self._mgr.array_values()

0 commit comments

Comments
 (0)