Skip to content

Commit

Permalink
TYPING: Small fixes to make stubgen happy (#25576)
Browse files Browse the repository at this point in the history
  • Loading branch information
Naddiseo authored and TomAugspurger committed Mar 8, 2019
1 parent 5c159d2 commit 0d893d0
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pandas/core/arrays/period.py
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,7 @@ def _raise_on_incompatible(left, right):
# Constructor Helpers

def period_array(data, freq=None, copy=False):
# type: (Sequence[Optional[Period]], Optional[Tick]) -> PeriodArray
# type: (Sequence[Optional[Period]], Optional[Tick], bool) -> PeriodArray
"""
Construct a new PeriodArray from a sequence of Period scalars.
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/arrays/sparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,7 @@ def _get_fill(arr):


def _sparse_array_op(left, right, op, name):
# type: (SparseArray, SparseArray, Callable, str) -> Any
"""
Perform a binary operation between two arrays.
Expand All @@ -413,7 +414,6 @@ def _sparse_array_op(left, right, op, name):
-------
SparseArray
"""
# type: (SparseArray, SparseArray, Callable, str) -> Any
if name.startswith('__'):
# For lookups in _libs.sparse we need non-dunder op name
name = name[2:-2]
Expand Down
4 changes: 2 additions & 2 deletions pandas/core/groupby/groupby.py
Original file line number Diff line number Diff line change
Expand Up @@ -1041,7 +1041,7 @@ def _bool_agg(self, val_test, skipna):
"""

def objs_to_bool(vals):
# type: np.ndarray -> (np.ndarray, typing.Type)
# type: (np.ndarray) -> (np.ndarray, typing.Type)
if is_object_dtype(vals):
vals = np.array([bool(x) for x in vals])
else:
Expand Down Expand Up @@ -1743,7 +1743,7 @@ def quantile(self, q=0.5, interpolation='linear'):
"""

def pre_processor(vals):
# type: np.ndarray -> (np.ndarray, Optional[typing.Type])
# type: (np.ndarray) -> (np.ndarray, Optional[typing.Type])
if is_object_dtype(vals):
raise TypeError("'quantile' cannot be performed against "
"'object' dtypes!")
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/internals/blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -1827,13 +1827,13 @@ def interpolate(self, method='pad', axis=0, inplace=False, limit=None,
placement=self.mgr_locs)

def shift(self, periods, axis=0, fill_value=None):
# type: (int, Optional[BlockPlacement], Any) -> List[ExtensionBlock]
"""
Shift the block by `periods`.
Dispatches to underlying ExtensionArray and re-boxes in an
ExtensionBlock.
"""
# type: (int, Optional[BlockPlacement]) -> List[ExtensionBlock]
return [
self.make_block_same_class(
self.values.shift(periods=periods, fill_value=fill_value),
Expand Down

0 comments on commit 0d893d0

Please sign in to comment.