Skip to content

Commit

Permalink
Fix typing issues for CI (pandas-dev#42770)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dr-Irv authored Jul 28, 2021
1 parent 8e07787 commit a38f3e1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion pandas/core/groupby/groupby.py
Original file line number Diff line number Diff line change
Expand Up @@ -2896,7 +2896,7 @@ def _get_cythonized_result(
grouper = self.grouper

ids, _, ngroups = grouper.group_info
output: dict[base.OutputKey, np.ndarray] = {}
output: dict[base.OutputKey, ArrayLike] = {}

base_func = getattr(libgroupby, how)
base_func = partial(base_func, labels=ids)
Expand All @@ -2911,6 +2911,7 @@ def blk_func(values: ArrayLike) -> ArrayLike:
else:
result_sz = len(values)

result: ArrayLike
result = np.zeros(result_sz, dtype=cython_dtype)
if needs_2d:
result = result.reshape((-1, 1))
Expand Down
6 changes: 5 additions & 1 deletion pandas/core/reshape/tile.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,11 @@ def _bins_to_cuts(
bins = unique_bins

side = "left" if right else "right"
ids = ensure_platform_int(bins.searchsorted(x, side=side))
# error: No overload variant of "searchsorted" of "ndarray" matches
# argument types "Any", "str"
ids = ensure_platform_int(
bins.searchsorted(x, side=side) # type: ignore[call-overload]
)

if include_lowest:
ids[np.asarray(x) == bins[0]] = 1
Expand Down

0 comments on commit a38f3e1

Please sign in to comment.