Skip to content

Commit 0d893d0

Browse files
NaddiseoTomAugspurger
authored andcommitted
TYPING: Small fixes to make stubgen happy (#25576)
1 parent 5c159d2 commit 0d893d0

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

pandas/core/arrays/period.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -710,7 +710,7 @@ def _raise_on_incompatible(left, right):
710710
# Constructor Helpers
711711

712712
def period_array(data, freq=None, copy=False):
713-
# type: (Sequence[Optional[Period]], Optional[Tick]) -> PeriodArray
713+
# type: (Sequence[Optional[Period]], Optional[Tick], bool) -> PeriodArray
714714
"""
715715
Construct a new PeriodArray from a sequence of Period scalars.
716716

pandas/core/arrays/sparse.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,7 @@ def _get_fill(arr):
397397

398398

399399
def _sparse_array_op(left, right, op, name):
400+
# type: (SparseArray, SparseArray, Callable, str) -> Any
400401
"""
401402
Perform a binary operation between two arrays.
402403
@@ -413,7 +414,6 @@ def _sparse_array_op(left, right, op, name):
413414
-------
414415
SparseArray
415416
"""
416-
# type: (SparseArray, SparseArray, Callable, str) -> Any
417417
if name.startswith('__'):
418418
# For lookups in _libs.sparse we need non-dunder op name
419419
name = name[2:-2]

pandas/core/groupby/groupby.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1041,7 +1041,7 @@ def _bool_agg(self, val_test, skipna):
10411041
"""
10421042

10431043
def objs_to_bool(vals):
1044-
# type: np.ndarray -> (np.ndarray, typing.Type)
1044+
# type: (np.ndarray) -> (np.ndarray, typing.Type)
10451045
if is_object_dtype(vals):
10461046
vals = np.array([bool(x) for x in vals])
10471047
else:
@@ -1743,7 +1743,7 @@ def quantile(self, q=0.5, interpolation='linear'):
17431743
"""
17441744

17451745
def pre_processor(vals):
1746-
# type: np.ndarray -> (np.ndarray, Optional[typing.Type])
1746+
# type: (np.ndarray) -> (np.ndarray, Optional[typing.Type])
17471747
if is_object_dtype(vals):
17481748
raise TypeError("'quantile' cannot be performed against "
17491749
"'object' dtypes!")

pandas/core/internals/blocks.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1827,13 +1827,13 @@ def interpolate(self, method='pad', axis=0, inplace=False, limit=None,
18271827
placement=self.mgr_locs)
18281828

18291829
def shift(self, periods, axis=0, fill_value=None):
1830+
# type: (int, Optional[BlockPlacement], Any) -> List[ExtensionBlock]
18301831
"""
18311832
Shift the block by `periods`.
18321833
18331834
Dispatches to underlying ExtensionArray and re-boxes in an
18341835
ExtensionBlock.
18351836
"""
1836-
# type: (int, Optional[BlockPlacement]) -> List[ExtensionBlock]
18371837
return [
18381838
self.make_block_same_class(
18391839
self.values.shift(periods=periods, fill_value=fill_value),

0 commit comments

Comments
 (0)