From 5c565a4fe1cb4238ebd5cfeec47a153392dfce76 Mon Sep 17 00:00:00 2001 From: FBruzzesi Date: Fri, 27 Dec 2024 09:00:41 +0100 Subject: [PATCH] forgot a file --- narwhals/_pandas_like/expr.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/narwhals/_pandas_like/expr.py b/narwhals/_pandas_like/expr.py index 298e152d4..e76c1940c 100644 --- a/narwhals/_pandas_like/expr.py +++ b/narwhals/_pandas_like/expr.py @@ -448,9 +448,12 @@ def func(df: PandasLikeDataFrame) -> list[PandasLikeSeries]: if self._function_name == "col->shift": kwargs = {"periods": self._kwargs.get("n", 1)} elif self._function_name == "col->rank": + _method = self._kwargs.get("method", "average") kwargs = { - "method": self._kwargs.get("method", "average"), + "method": "first" if _method == "ordinal" else _method, "ascending": not self._kwargs.get("descending", False), + "na_option": "keep", + "pct": False, } else: # Cumulative operation kwargs = {"skipna": True}