Skip to content

Commit de1f293

Browse files
committed
fixes
1 parent 33c2d0d commit de1f293

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

pandas-stubs/_libs/tslibs/__init__.pyi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ __all__ = [
1010
"Tick",
1111
"OutOfBoundsDatetime",
1212
]
13-
1413
from pandas._libs.tslibs.np_datetime import OutOfBoundsDatetime as OutOfBoundsDatetime
1514

1615
from .nattype import (

pandas-stubs/_typing.pyi

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,4 @@ Function = Union[np.ufunc, Callable[..., Any]]
203203
GroupByObjectNonScalar = Union[
204204
tuple, list[Label], Function, Series, np.ndarray, Mapping[Label, Any], Index
205205
]
206-
GroupByObject = Union[
207-
Label, list[Label], Function, Series, np.ndarray, Mapping[Label, Any], Index
208-
]
206+
GroupByObject = Union[Scalar, GroupByObjectNonScalar]

tests/test_frame.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
Hashable,
1111
Iterable,
1212
Iterator,
13+
Tuple,
1314
)
1415

1516
import numpy as np
@@ -1253,17 +1254,17 @@ def test_groupby_result() -> None:
12531254
# GH 142
12541255
df = pd.DataFrame({"a": [0, 1, 2], "b": [4, 5, 6], "c": [7, 8, 9]})
12551256
iterator = df.groupby(["a", "b"]).__iter__()
1256-
assert_type(iterator, Iterator[tuple[tuple, pd.DataFrame]])
1257+
assert_type(iterator, Iterator[Tuple[tuple, pd.DataFrame]])
12571258
index, value = next(iterator)
1258-
assert_type((index, value), tuple[tuple, pd.DataFrame])
1259+
assert_type((index, value), Tuple[tuple, pd.DataFrame])
12591260

12601261
check(assert_type(index, tuple), tuple, np.int64)
12611262
check(assert_type(value, pd.DataFrame), pd.DataFrame)
12621263

12631264
iterator2 = df.groupby("a").__iter__()
1264-
assert_type(iterator2, Iterator[tuple[Scalar, pd.DataFrame]])
1265+
assert_type(iterator2, Iterator[Tuple[Scalar, pd.DataFrame]])
12651266
index2, value2 = next(iterator2)
1266-
assert_type((index2, value2), tuple[Scalar, pd.DataFrame])
1267+
assert_type((index2, value2), Tuple[Scalar, pd.DataFrame])
12671268

12681269
check(assert_type(index2, Scalar), int)
12691270
check(assert_type(value2, pd.DataFrame), pd.DataFrame)

0 commit comments

Comments
 (0)