|
9 | 9 | import copy |
10 | 10 | from functools import partial |
11 | 11 | from textwrap import dedent |
12 | | -import typing |
13 | 12 | from typing import ( |
14 | 13 | TYPE_CHECKING, |
15 | 14 | Any, |
|
22 | 21 | Optional, |
23 | 22 | Sequence, |
24 | 23 | Type, |
| 24 | + TypeVar, |
25 | 25 | Union, |
26 | 26 | ) |
27 | 27 | import warnings |
|
92 | 92 | # TODO: validate types on ScalarResult and move to _typing |
93 | 93 | # Blocked from using by https://github.com/python/mypy/issues/1484 |
94 | 94 | # See note at _mangle_lambda_list |
95 | | -ScalarResult = typing.TypeVar("ScalarResult") |
| 95 | +ScalarResult = TypeVar("ScalarResult") |
96 | 96 |
|
97 | 97 |
|
98 | 98 | def generate_property(name: str, klass: Type[FrameOrSeries]): |
@@ -606,8 +606,8 @@ def filter(self, func, dropna=True, *args, **kwargs): |
606 | 606 | wrapper = lambda x: func(x, *args, **kwargs) |
607 | 607 |
|
608 | 608 | # Interpret np.nan as False. |
609 | | - def true_and_notna(x, *args, **kwargs) -> bool: |
610 | | - b = wrapper(x, *args, **kwargs) |
| 609 | + def true_and_notna(x) -> bool: |
| 610 | + b = wrapper(x) |
611 | 611 | return b and notna(b) |
612 | 612 |
|
613 | 613 | try: |
@@ -1210,7 +1210,7 @@ def _wrap_applied_output(self, keys, values, not_indexed_same=False): |
1210 | 1210 | # TODO: Remove when default dtype of empty Series is object |
1211 | 1211 | kwargs = first_not_none._construct_axes_dict() |
1212 | 1212 | backup = create_series_with_explicit_dtype( |
1213 | | - **kwargs, dtype_if_empty=object |
| 1213 | + dtype_if_empty=object, **kwargs |
1214 | 1214 | ) |
1215 | 1215 |
|
1216 | 1216 | values = [x if (x is not None) else backup for x in values] |
|
0 commit comments