Skip to content

Commit f1ec0e5

Browse files
committed
TYP: Add Literal annotations to TimeGrouper
This doesn't affect the behaviour, since the possible values are already restricted a few lines above this.
1 parent 7dd22b8 commit f1ec0e5

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

pandas/core/resample.py

+3-6
Original file line numberDiff line numberDiff line change
@@ -1470,14 +1470,14 @@ def __init__(
14701470
self,
14711471
freq="Min",
14721472
closed: Literal["left", "right"] | None = None,
1473-
label: str | None = None,
1473+
label: Literal["left", "right"] | None = None,
14741474
how="mean",
14751475
axis=0,
14761476
fill_method=None,
14771477
limit=None,
14781478
loffset=None,
14791479
kind: str | None = None,
1480-
convention: str | None = None,
1480+
convention: Literal["start", "end", "e", "s"] | None = None,
14811481
base: int | None = None,
14821482
origin: str | TimestampConvertibleTypes = "start_day",
14831483
offset: TimedeltaConvertibleTypes | None = None,
@@ -1523,10 +1523,7 @@ def __init__(
15231523
self.closed = closed
15241524
self.label = label
15251525
self.kind = kind
1526-
1527-
self.convention = convention or "E"
1528-
self.convention = self.convention.lower()
1529-
1526+
self.convention = convention if convention is not None else "e"
15301527
self.how = how
15311528
self.fill_method = fill_method
15321529
self.limit = limit

0 commit comments

Comments
 (0)