19
19
20
20
ExprT = TypeVar ("ExprT" , bound = PandasExpr )
21
21
22
- from narwhals .pandas_like .typing import IntoExpr
22
+ from narwhals .pandas_like .typing import IntoPandasExpr
23
23
24
24
25
25
def validate_column_comparand (other : Any ) -> Any :
@@ -85,15 +85,17 @@ def maybe_evaluate_expr(df: PandasDataFrame, arg: Any) -> Any:
85
85
86
86
87
87
def parse_into_exprs (
88
- implementation : str , * exprs : IntoExpr | Iterable [IntoExpr ], ** named_exprs : IntoExpr
88
+ implementation : str ,
89
+ * exprs : IntoPandasExpr | Iterable [IntoPandasExpr ],
90
+ ** named_exprs : IntoPandasExpr ,
89
91
) -> list [PandasExpr ]:
90
92
out = [parse_into_expr (implementation , into_expr ) for into_expr in flatten (* exprs )] # type: ignore[arg-type]
91
93
for name , expr in named_exprs .items ():
92
94
out .append (parse_into_expr (implementation , expr ).alias (name ))
93
95
return out
94
96
95
97
96
- def parse_into_expr (implementation : str , into_expr : IntoExpr ) -> PandasExpr :
98
+ def parse_into_expr (implementation : str , into_expr : IntoPandasExpr ) -> PandasExpr :
97
99
from narwhals .expression import Expr
98
100
from narwhals .pandas_like .namespace import Namespace
99
101
@@ -107,7 +109,9 @@ def parse_into_expr(implementation: str, into_expr: IntoExpr) -> PandasExpr:
107
109
raise TypeError (msg )
108
110
109
111
110
- def evaluate_into_expr (df : PandasDataFrame , into_expr : IntoExpr ) -> list [PandasSeries ]:
112
+ def evaluate_into_expr (
113
+ df : PandasDataFrame , into_expr : IntoPandasExpr
114
+ ) -> list [PandasSeries ]:
111
115
"""
112
116
Return list of raw columns.
113
117
"""
@@ -117,8 +121,8 @@ def evaluate_into_expr(df: PandasDataFrame, into_expr: IntoExpr) -> list[PandasS
117
121
118
122
def evaluate_into_exprs (
119
123
df : PandasDataFrame ,
120
- * exprs : IntoExpr | Iterable [IntoExpr ],
121
- ** named_exprs : IntoExpr ,
124
+ * exprs : IntoPandasExpr | Iterable [IntoPandasExpr ],
125
+ ** named_exprs : IntoPandasExpr ,
122
126
) -> list [PandasSeries ]:
123
127
"""Evaluate each expr into Series."""
124
128
series : list [PandasSeries ] = [
0 commit comments