Skip to content

Commit 561bcea

Browse files
maanijouMilad Maani Jou
and
Milad Maani Jou
authored
Fixed literal typing in rank and resample methods (#52745)
Co-authored-by: Milad Maani Jou <[email protected]>
1 parent b05a6c2 commit 561bcea

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

pandas/core/generic.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -8613,10 +8613,10 @@ def resample(
86138613
self,
86148614
rule,
86158615
axis: Axis | lib.NoDefault = lib.no_default,
8616-
closed: str | None = None,
8617-
label: str | None = None,
8618-
convention: str = "start",
8619-
kind: str | None = None,
8616+
closed: Literal["right", "left"] | None = None,
8617+
label: Literal["right", "left"] | None = None,
8618+
convention: Literal["start", "end", "s", "e"] = "start",
8619+
kind: Literal["timestamp", "period"] | None = None,
86208620
on: Level = None,
86218621
level: Level = None,
86228622
origin: str | TimestampConvertibleTypes = "start_day",
@@ -9173,9 +9173,9 @@ def last(self, offset) -> Self:
91739173
def rank(
91749174
self,
91759175
axis: Axis = 0,
9176-
method: str = "average",
9176+
method: Literal["average", "min", "max", "first", "dense"] = "average",
91779177
numeric_only: bool_t = False,
9178-
na_option: str = "keep",
9178+
na_option: Literal["keep", "top", "bottom"] = "keep",
91799179
ascending: bool_t = True,
91809180
pct: bool_t = False,
91819181
) -> Self:

0 commit comments

Comments
 (0)