Skip to content

Commit 5aeb6cd

Browse files
authored
CLN: update flake8-pyi (#169)
* remove future from pyi files * complex > float > int
1 parent cdec539 commit 5aeb6cd

File tree

212 files changed

+38
-470
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

212 files changed

+38
-470
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ repos:
2727
- id: flake8
2828
name: flake8 (pyi)
2929
additional_dependencies:
30-
- flake8-pyi==22.5.1
30+
- flake8-pyi==22.7.0
3131
types: [pyi]
3232
args: [
3333
--ignore=E301 E302 E305 E402 E501 E701 E704 F401 F811 W503 Y019 Y026 Y027 Y034 Y037,

pandas-stubs/__init__.pyi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
import pandas.testing as testing
42

53
from . import (

pandas-stubs/_config/__init__.pyi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
from .config import (
42
describe_option as describe_option,
53
get_option as get_option,

pandas-stubs/_config/config.pyi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
from contextlib import ContextDecorator
42
from typing import (
53
Any,

pandas-stubs/_libs/__init__.pyi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
from .interval import Interval as Interval
42
from .tslibs import (
53
NaT as NaT,

pandas-stubs/_libs/indexing.pyi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
class _NDFrameIndexerBase:
42
def __init__(self, name: str, obj: object) -> None: ...
53
@property

pandas-stubs/_libs/interval.pyi

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
from typing import (
42
Any,
53
Generic,
@@ -78,7 +76,7 @@ class Interval(IntervalMixin, Generic[_OrderableT]):
7876
@overload
7977
def __contains__(self: Interval[_OrderableTimesT], _OrderableTimesT) -> bool: ...
8078
@overload
81-
def __contains__(self: Interval[_OrderableScalarT], key: int | float) -> bool: ...
79+
def __contains__(self: Interval[_OrderableScalarT], key: float) -> bool: ...
8280
@overload
8381
def __add__(
8482
self: Interval[_OrderableTimesT], y: Timedelta
@@ -88,7 +86,7 @@ class Interval(IntervalMixin, Generic[_OrderableT]):
8886
self: Interval[int], y: _OrderableScalarT
8987
) -> Interval[_OrderableScalarT]: ...
9088
@overload
91-
def __add__(self: Interval[float], y: int | float) -> Interval[float]: ...
89+
def __add__(self: Interval[float], y: float) -> Interval[float]: ...
9290
@overload
9391
def __radd__(
9492
self: Interval[_OrderableTimesT], y: Timedelta
@@ -98,7 +96,7 @@ class Interval(IntervalMixin, Generic[_OrderableT]):
9896
self: Interval[int], y: _OrderableScalarT
9997
) -> Interval[_OrderableScalarT]: ...
10098
@overload
101-
def __radd__(self: Interval[float], y: int | float) -> Interval[float]: ...
99+
def __radd__(self: Interval[float], y: float) -> Interval[float]: ...
102100
@overload
103101
def __sub__(
104102
self: Interval[_OrderableTimesT], y: Timedelta
@@ -108,7 +106,7 @@ class Interval(IntervalMixin, Generic[_OrderableT]):
108106
self: Interval[int], y: _OrderableScalarT
109107
) -> Interval[_OrderableScalarT]: ...
110108
@overload
111-
def __sub__(self: Interval[float], y: int | float) -> Interval[float]: ...
109+
def __sub__(self: Interval[float], y: float) -> Interval[float]: ...
112110
@overload
113111
def __rsub__(
114112
self: Interval[_OrderableTimesT], y: Timedelta
@@ -118,31 +116,31 @@ class Interval(IntervalMixin, Generic[_OrderableT]):
118116
self: Interval[int], y: _OrderableScalarT
119117
) -> Interval[_OrderableScalarT]: ...
120118
@overload
121-
def __rsub__(self: Interval[float], y: int | float) -> Interval[float]: ...
119+
def __rsub__(self: Interval[float], y: float) -> Interval[float]: ...
122120
@overload
123121
def __mul__(
124122
self: Interval[int], y: _OrderableScalarT
125123
) -> Interval[_OrderableScalarT]: ...
126124
@overload
127-
def __mul__(self: Interval[float], y: int | float) -> Interval[float]: ...
125+
def __mul__(self: Interval[float], y: float) -> Interval[float]: ...
128126
@overload
129127
def __rmul__(
130128
self: Interval[int], y: _OrderableScalarT
131129
) -> Interval[_OrderableScalarT]: ...
132130
@overload
133-
def __rmul__(self: Interval[float], y: int | float) -> Interval[float]: ...
131+
def __rmul__(self: Interval[float], y: float) -> Interval[float]: ...
134132
@overload
135133
def __truediv__(
136134
self: Interval[int], y: _OrderableScalarT
137135
) -> Interval[_OrderableScalarT]: ...
138136
@overload
139-
def __truediv__(self: Interval[float], y: int | float) -> Interval[float]: ...
137+
def __truediv__(self: Interval[float], y: float) -> Interval[float]: ...
140138
@overload
141139
def __floordiv__(
142140
self: Interval[int], y: _OrderableScalarT
143141
) -> Interval[_OrderableScalarT]: ...
144142
@overload
145-
def __floordiv__(self: Interval[float], y: int | float) -> Interval[float]: ...
143+
def __floordiv__(self: Interval[float], y: float) -> Interval[float]: ...
146144
def overlaps(self: Interval[_OrderableT], other: Interval[_OrderableT]) -> bool: ...
147145

148146
def intervals_to_interval_bounds(

pandas-stubs/_libs/json.pyi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
def decode(*args, **kwargs): ...
42
def dumps(*args, **kwargs): ...
53
def encode(*args, **kwargs): ...

pandas-stubs/_libs/lib.pyi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
no_default = None
42

53
def infer_dtype(value: object, skipna: bool = ...) -> str: ...

pandas-stubs/_libs/missing.pyi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
class NAType:
42
def __new__(cls, *args, **kwargs) -> NAType: ...
53
def __format__(self, format_spec: str) -> str: ...

pandas-stubs/_libs/ops_dispatch.pyi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
DISPATCHED_UFUNCS = ...
42
REVERSED_NAMES = ...
53
UFUNC_ALIASES = ...

pandas-stubs/_libs/properties.pyi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
from typing import Callable
42

53
class CachedProperty:

pandas-stubs/_libs/sparse.pyi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
class SparseIndex: ...
42
class BlockIndex(SparseIndex): ...
53
class IntIndex(SparseIndex): ...

pandas-stubs/_libs/tslibs/__init__.pyi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
__all__ = [
42
"Period",
53
"Timestamp",

pandas-stubs/_libs/tslibs/base.pyi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
from datetime import datetime
42

53
class ABCTimestamp(datetime): ...

pandas-stubs/_libs/tslibs/ccalendar.pyi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
from typing import Sequence
42

53
def dayofweek(y: int, m: int, d: int) -> int: ...

pandas-stubs/_libs/tslibs/conversion.pyi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
from datetime import datetime
42

53
def localize_pydatetime(dt: datetime, tz: object) -> datetime: ...

pandas-stubs/_libs/tslibs/dtypes.pyi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
from enum import Enum
42

53
from .offsets import BaseOffset

pandas-stubs/_libs/tslibs/nattype.pyi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
from datetime import (
42
datetime,
53
timedelta,
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
from __future__ import annotations
2-
31
class OutOfBoundsDatetime(ValueError): ...

pandas-stubs/_libs/tslibs/offsets.pyi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
from datetime import (
42
datetime,
53
timedelta,

pandas-stubs/_libs/tslibs/parsing.pyi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
from typing import Any
42

53
def parse_time_string(*args, **kwargs) -> Any: ...

pandas-stubs/_libs/tslibs/period.pyi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
from datetime import datetime
42
from typing import Any
53

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
from typing import Any
42

53
def array_strptime(*args, **kwargs) -> Any: ...

pandas-stubs/_libs/tslibs/timedeltas.pyi

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
from datetime import timedelta
42
from typing import (
53
ClassVar,
@@ -84,7 +82,7 @@ class Timedelta(timedelta):
8482
cls: type[_S],
8583
value=...,
8684
unit: str = ...,
87-
**kwargs: int | float | np.integer | np.floating,
85+
**kwargs: float | np.integer | np.floating,
8886
) -> _S: ...
8987
# GH 46171
9088
# While Timedelta can return pd.NaT, having the constructor return
@@ -119,7 +117,7 @@ class Timedelta(timedelta):
119117
@overload # type: ignore[override]
120118
def __floordiv__(self, other: timedelta) -> int: ...
121119
@overload
122-
def __floordiv__(self, other: int | float) -> Timedelta: ...
120+
def __floordiv__(self, other: float) -> Timedelta: ...
123121
@overload
124122
def __floordiv__(
125123
self, other: npt.NDArray[np.timedelta64]

pandas-stubs/_libs/tslibs/timestamps.pyi

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
from datetime import (
42
date as _date,
53
datetime,
@@ -35,13 +33,7 @@ class Timestamp(datetime):
3533
value: int # np.int64
3634
def __new__(
3735
cls: type[_DatetimeT],
38-
ts_input: int
39-
| np.integer
40-
| float
41-
| str
42-
| _date
43-
| datetime
44-
| np.datetime64 = ...,
36+
ts_input: np.integer | float | str | _date | datetime | np.datetime64 = ...,
4537
freq: int | str | BaseOffset | None = ...,
4638
tz: str | _tzinfo | int | None = ...,
4739
unit: str | int | None = ...,
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
from __future__ import annotations
2-
31
def tz_convert_from_utc_single(val: int, tz: str) -> int: ...

pandas-stubs/_libs/tslibs/vectorized.pyi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
from typing import Sequence
42

53
import numpy as np

pandas-stubs/_testing/__init__.pyi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
from typing import Literal
42

53
from pandas.core.frame import DataFrame

pandas-stubs/_typing.pyi

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
from builtins import type as type_t
42
import datetime
53
from io import (
@@ -43,16 +41,14 @@ from pandas.core.dtypes.dtypes import ExtensionDtype
4341

4442
ArrayLike = Union[ExtensionArray, np.ndarray]
4543
AnyArrayLike = Union[Index, Series, np.ndarray]
46-
PythonScalar = Union[str, int, float, bool, complex]
44+
PythonScalar = Union[str, bool, complex]
4745
DatetimeLikeScalar = TypeVar("DatetimeLikeScalar", Period, Timestamp, Timedelta)
4846
PandasScalar = Union[bytes, datetime.date, datetime.datetime, datetime.timedelta]
4947
# Scalar = Union[PythonScalar, PandasScalar]
5048
IntStrT = TypeVar("IntStrT", int, str)
5149

5250
# dtypes
53-
NpDtype = Union[
54-
str, np.dtype[np.generic], type[Union[str, float, int, complex, bool, object]]
55-
]
51+
NpDtype = Union[str, np.dtype[np.generic], type[Union[str, complex, bool, object]]]
5652
Dtype = Union[ExtensionDtype, NpDtype]
5753
AstypeArg = Union[ExtensionDtype, npt.DTypeLike]
5854
# DtypeArg specifies all allowable dtypes in a functions its dtype argument
@@ -97,7 +93,7 @@ AggFuncType = Union[
9793
AggFuncTypeDict,
9894
]
9995

100-
num = Union[int, float, complex]
96+
num = complex
10197
SeriesAxisType = Literal["index", 0] # Restricted subset of _AxisType for series
10298
AxisType = Literal["columns", "index", 0, 1]
10399
DtypeNp = TypeVar("DtypeNp", bound=np.dtype[np.generic])
@@ -111,8 +107,6 @@ Scalar = Union[
111107
datetime.datetime,
112108
datetime.timedelta,
113109
bool,
114-
int,
115-
float,
116110
complex,
117111
Timestamp,
118112
Timedelta,

pandas-stubs/_version.pyi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
from typing import Literal
42

53
version_json: str = ...

pandas-stubs/api/__init__.pyi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
from . import (
42
extensions as extensions,
53
indexers as indexers,

pandas-stubs/api/extensions/__init__.pyi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
from pandas.core.accessor import (
42
register_dataframe_accessor as register_dataframe_accessor,
53
register_index_accessor as register_index_accessor,

pandas-stubs/api/indexers/__init__.pyi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
from pandas.core.indexers import check_array_indexer as check_array_indexer
42
from pandas.core.window.indexers import (
53
BaseIndexer as BaseIndexer,

pandas-stubs/api/types/__init__.pyi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
from pandas._libs.lib import infer_dtype as infer_dtype
42

53
from pandas.core.dtypes.api import (

pandas-stubs/arrays/__init__.pyi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
from pandas.core.arrays import (
42
BooleanArray as BooleanArray,
53
Categorical as Categorical,

pandas-stubs/compat/__init__.pyi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
PY37 = ...
42
PY38 = ...
53
PYPY = ...

pandas-stubs/compat/_optional.pyi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
VERSIONS = ...
42

53
def import_optional_dependency(

pandas-stubs/compat/numpy/__init__.pyi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
import numpy as np
42

53
_np_version: str = ...

pandas-stubs/compat/pickle_compat.pyi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
import pickle as pkl
42

53
def load_reduce(self) -> None: ...

pandas-stubs/core/accessor.pyi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
from typing import Any
42

53
class DirNamesMixin:

pandas-stubs/core/algorithms.pyi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
from typing import Any
42

53
import numpy as np

pandas-stubs/core/api.pyi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
from pandas.core.algorithms import (
42
factorize as factorize,
53
unique as unique,

0 commit comments

Comments
 (0)