Skip to content

Commit af44ad4

Browse files
committed
Merge remote-tracking branch 'upstream/main' into scalars-interval
2 parents 794a577 + b7163c2 commit af44ad4

25 files changed

+571
-42
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ repos:
1111
hooks:
1212
- id: isort
1313
- repo: https://github.com/asottile/pyupgrade
14-
rev: v2.37.3
14+
rev: v3.2.0
1515
hooks:
1616
- id: pyupgrade
1717
types_or: [python, pyi]
@@ -27,7 +27,7 @@ repos:
2727
- id: flake8
2828
name: flake8 (pyi)
2929
additional_dependencies:
30-
- flake8-pyi==22.8.2
30+
- flake8-pyi==22.10.0
3131
types: [pyi]
3232
args: [
3333
--ignore=E301 E302 E305 E402 E501 E701 E704 F401 F811 W503 Y019 Y027 Y034 Y037 Y041 Y042,

pandas-stubs/_libs/tslibs/offsets.pyi

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from datetime import (
22
date,
33
datetime,
4+
time,
45
timedelta,
56
)
67
from typing import (
@@ -78,6 +79,7 @@ class BaseOffset:
7879
def name(self) -> str: ...
7980
@property
8081
def rule_code(self) -> str: ...
82+
@property
8183
def freqstr(self) -> str: ...
8284
def apply_index(self, dtindex: DatetimeIndex) -> DatetimeIndex: ...
8385
def rollback(self, dt: datetime) -> datetime: ...
@@ -131,8 +133,8 @@ class BusinessHour(BusinessMixin):
131133
self,
132134
n: int = ...,
133135
normalize: bool = ...,
134-
start: str | Collection[str] = ...,
135-
end: str | Collection[str] = ...,
136+
start: str | time | Collection[str | time] = ...,
137+
end: str | time | Collection[str | time] = ...,
136138
offset: timedelta = ...,
137139
): ...
138140

@@ -217,8 +219,8 @@ class CustomBusinessHour(BusinessHour):
217219
self,
218220
n: int = ...,
219221
normalize: bool = ...,
220-
start: str = ...,
221-
end: str = ...,
222+
start: str | time | Collection[str | time] = ...,
223+
end: str | time | Collection[str | time] = ...,
222224
offset: timedelta = ...,
223225
holidays: list | None = ...,
224226
): ...

pandas-stubs/_testing/__init__.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def assert_series_equal(
7474
obj: str = ...,
7575
*,
7676
check_index: Literal[False],
77-
check_like: Literal[False],
77+
check_like: Literal[False] = ...,
7878
) -> None: ...
7979
@overload
8080
def assert_series_equal(

pandas-stubs/core/base.pyi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ class IndexOpsMixin:
6363
def tolist(self) -> list: ...
6464
def to_list(self) -> list: ...
6565
def __iter__(self): ...
66+
@property
6667
def hasnans(self) -> bool: ...
6768
def value_counts(
6869
self,

pandas-stubs/core/dtypes/common.pyi

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ from pandas.core.dtypes.inference import (
2828
is_scalar as is_scalar,
2929
)
3030

31-
_ArrayOrDtype: TypeAlias = Union[ArrayLike, npt.DTypeLike, pd.Series, pd.DataFrame]
31+
_ArrayOrDtype: TypeAlias = Union[
32+
ArrayLike, npt.DTypeLike, pd.Series, pd.DataFrame, pd.Index
33+
]
3234

3335
def is_object_dtype(arr_or_dtype: _ArrayOrDtype) -> bool: ...
3436
def is_sparse(arr: ArrayLike | pd.Series | pd.DataFrame) -> bool: ...

pandas-stubs/core/frame.pyi

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1276,8 +1276,6 @@ class DataFrame(NDFrame, OpsMixin):
12761276
@property
12771277
def at(self): ... # Not sure what to do with this yet; look at source
12781278
@property
1279-
def bool(self) -> _bool: ...
1280-
@property
12811279
def columns(self) -> Index: ...
12821280
@columns.setter # setter needs to be right next to getter; otherwise mypy complains
12831281
def columns(
@@ -1359,7 +1357,7 @@ class DataFrame(NDFrame, OpsMixin):
13591357
) -> DataFrame: ...
13601358
def astype(
13611359
self,
1362-
dtype: _str | Dtype | dict[_str, _str | Dtype],
1360+
dtype: _str | Dtype | dict[_str, _str | Dtype] | Series,
13631361
copy: _bool = ...,
13641362
errors: _str = ...,
13651363
) -> DataFrame: ...

pandas-stubs/core/generic.pyi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ from typing import (
88
Literal,
99
Mapping,
1010
Sequence,
11+
final,
1112
overload,
1213
)
1314

@@ -83,6 +84,7 @@ class NDFrame(PandasObject, indexing.IndexingMixin):
8384
def __neg__(self: NDFrameT) -> NDFrameT: ...
8485
def __pos__(self: NDFrameT) -> NDFrameT: ...
8586
def __nonzero__(self) -> None: ...
87+
@final
8688
def bool(self) -> _bool: ...
8789
def __abs__(self) -> NDFrame: ...
8890
def __round__(self, decimals: int = ...) -> NDFrame: ...

pandas-stubs/core/groupby/ops.pyi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ class BinGrouper(BaseGrouper):
7070
def get_iterator(self, data: DataFrame | Series, axis: int = ...): ...
7171
def indices(self): ...
7272
def group_info(self): ...
73+
@property
7374
def reconstructed_codes(self) -> list[np.ndarray]: ...
7475
def result_index(self): ...
7576
@property

pandas-stubs/core/indexes/base.pyi

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ class Index(IndexOpsMixin, PandasObject):
112112
def is_monotonic_increasing(self) -> bool: ...
113113
@property
114114
def is_monotonic_decreasing(self) -> bool: ...
115+
@property
115116
def is_unique(self) -> bool: ...
116117
@property
117118
def has_duplicates(self) -> bool: ...
@@ -124,9 +125,10 @@ class Index(IndexOpsMixin, PandasObject):
124125
def is_interval(self) -> bool: ...
125126
def is_mixed(self) -> bool: ...
126127
def holds_integer(self): ...
128+
@property
127129
def inferred_type(self): ...
128-
def is_all_dates(self) -> bool: ...
129130
def __reduce__(self): ...
131+
@property
130132
def hasnans(self) -> bool: ...
131133
def isna(self): ...
132134
isnull = ...
@@ -177,6 +179,7 @@ class Index(IndexOpsMixin, PandasObject):
177179
): ...
178180
@property
179181
def values(self) -> np.ndarray: ...
182+
@property
180183
def array(self) -> ExtensionArray: ...
181184
def memory_usage(self, deep: bool = ...): ...
182185
def where(self, cond, other=...): ...

pandas-stubs/core/indexes/category.pyi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ class CategoricalIndex(ExtensionIndex, accessor.PandasDelegate):
2828
def __array__(self, dtype=...) -> np.ndarray: ...
2929
def astype(self, dtype: DtypeArg, copy: bool = ...) -> Index: ...
3030
def fillna(self, value=..., downcast=...): ...
31+
@property
3132
def is_unique(self) -> bool: ...
3233
@property
3334
def is_monotonic_increasing(self) -> bool: ...

0 commit comments

Comments
 (0)