Skip to content

Commit e34433a

Browse files
authored
fix(typing): Include Expr in fill_null signature (#2129)
Follow-up to (#2106) Resolves https://github.com/narwhals-dev/narwhals/pull/2106/files#r1976489510
1 parent e0e5ba4 commit e34433a

File tree

5 files changed

+7
-5
lines changed

5 files changed

+7
-5
lines changed

narwhals/_arrow/expr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ def sample(
361361

362362
def fill_null(
363363
self: Self,
364-
value: Any | None,
364+
value: Self | Any | None,
365365
strategy: Literal["forward", "backward"] | None,
366366
limit: int | None,
367367
) -> Self:

narwhals/_dask/expr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ def any(self: Self) -> Self:
406406

407407
def fill_null(
408408
self: Self,
409-
value: Any | None,
409+
value: Self | Any | None,
410410
strategy: Literal["forward", "backward"] | None,
411411
limit: int | None,
412412
) -> DaskExpr:

narwhals/_duckdb/expr.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,9 @@ def round(self: Self, decimals: int) -> Self:
445445
lambda _input: FunctionExpression("round", _input, lit(decimals)), "round"
446446
)
447447

448-
def fill_null(self: Self, value: Any, strategy: Any, limit: int | None) -> Self:
448+
def fill_null(
449+
self: Self, value: Self | Any, strategy: Any, limit: int | None
450+
) -> Self:
449451
if strategy is not None:
450452
msg = "todo"
451453
raise NotImplementedError(msg)

narwhals/_pandas_like/expr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ def is_nan(self: Self) -> Self:
315315

316316
def fill_null(
317317
self: Self,
318-
value: Any | None,
318+
value: Self | Any | None,
319319
strategy: Literal["forward", "backward"] | None,
320320
limit: int | None,
321321
) -> Self:

narwhals/expr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1327,7 +1327,7 @@ def arg_true(self: Self) -> Self:
13271327

13281328
def fill_null(
13291329
self: Self,
1330-
value: Any | None = None,
1330+
value: Expr | Any | None = None,
13311331
strategy: Literal["forward", "backward"] | None = None,
13321332
limit: int | None = None,
13331333
) -> Self:

0 commit comments

Comments
 (0)