@@ -420,11 +420,9 @@ def __rmod__(self, other: DaftExpr) -> DaftExpr:
420420 )
421421
422422 def __pow__ (self , other : DaftExpr ) -> DaftExpr :
423- if other ._metadata .is_literal :
424- other_lit = evaluate_literal (other )
425- return self ._with_callable (lambda expr : (expr ** other_lit ))
426- msg = "`pow` with non-literal input is not yet supported"
427- raise NotImplementedError (msg )
423+ return self ._with_elementwise (
424+ lambda _input , expr : F .pow (_input , expr ), expr = other
425+ )
428426
429427 def __rpow__ (self , other : DaftExpr ) -> DaftExpr :
430428 if other ._metadata .is_literal :
@@ -844,6 +842,14 @@ def _partitioned_rank(
844842
845843 return self ._with_callable (_unpartitioned_rank , _partitioned_rank )
846844
845+ def fill_nan (self , value : float | None ) -> DaftExpr :
846+ def func (expr : Expression ) -> Expression :
847+ if value is None :
848+ return F .when (expr .is_nan (), lit (None )).otherwise (expr )
849+ return expr .fill_nan (lit (value ))
850+
851+ return self ._with_callable (func )
852+
847853 @property
848854 def name (self ) -> ExprNameNamespace :
849855 return ExprNameNamespace (self )
@@ -861,7 +867,6 @@ def list(self) -> ExprListNamespace:
861867 return ExprListNamespace (self )
862868
863869 drop_nulls = not_implemented ()
864- fill_nan = not_implemented ()
865870 filter = not_implemented ()
866871 ewm_mean = not_implemented ()
867872 kurtosis = not_implemented ()
0 commit comments