8000 Misc Type Annotation fixes by gwrome · Pull Request #26372 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

Misc Type Annotation fixes #26372

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
May 18, 2019
Merged
Prev Previous commit
Next Next commit
Whatsnew, second rev indexing, window and pytables
  • Loading branch information
gwrome committed May 13, 2019
commit 2eeff8cb9eee425e8dfb195944bdbd137b5b2b9c
1 change: 1 addition & 0 deletions doc/source/whatsnew/v0.25.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ Other API Changes
- Comparing :class:`Timestamp` with unsupported objects now returns :py:obj:`NotImplemented` instead of raising ``TypeError``. This implies that unsupported rich comparisons are delegated to the other object, and are now consistent with Python 3 behavior for ``datetime`` objects (:issue:`24011`)
- Bug in :meth:`DatetimeIndex.snap` which didn't preserving the ``name`` of the input :class:`Index` (:issue:`25575`)
- The ``arg`` argument in :meth:`pandas.core.groupby.DataFrameGroupBy.agg` has been renamed to ``func`` (:issue:`26089`)
- The ``arg`` argument in :meth:`pandas.core.window._Window.aggregate` has been renamed to ``func`` (:issue:`26372`)

.. _whatsnew_0250.deprecations:

Expand Down
3 changes: 1 addition & 2 deletions pandas/core/indexing.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import textwrap
from typing import Type
import warnings

import numpy as np
Expand Down Expand Up @@ -90,7 +89,7 @@ class IndexingError(Exception):

class _NDFrameIndexer(_NDFrameIndexerBase):
_valid_types = None # type: str
_exception = KeyError # type: Type[Exception]
_exception = Exception
axis = None

def __call__(self, axis=None):
Expand Down
8 changes: 2 additions & 6 deletions pandas/core/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from collections import defaultdict
from datetime import timedelta
from textwrap import dedent
from typing import Set, no_type_check
from typing import Set
import warnings

import numpy as np
Expand Down Expand Up @@ -789,11 +789,7 @@ def __init__(self, obj, *args, **kwargs):
corr = GroupByMixin._dispatch('corr', other=None, pairwise=None)
cov = GroupByMixin._dispatch('cov', other=None, pairwise=None)

# Removed from type checking because there is currently no good way to
# handle multiple inheritance with mypy
# https://github.com/python/mypy/issues/2125
@no_type_check
def _apply(self, func, name, window=None, center=None,
def _apply(self, func, name=None, window=None, center=None,
check_minp=None, **kwargs):
"""
Dispatch to apply; we are stripping all of the _apply kwargs and
Expand Down
2 changes: 1 addition & 1 deletion pandas/io/pytables.py
Original file line number Diff line number Diff line change
Expand Up @@ -3053,7 +3053,7 @@ class Table(Fixed):

"""
pandas_kind = 'wide_table'
table_type = None # type: Optional[str]
table_type = None # type: str
levels = 1
is_table = True
is_shape_reversed = False
Expand Down
0