-
Notifications
You must be signed in to change notification settings - Fork 182
Open
Labels
Description
e.g.
import duckdb
import narwhals as nw
rel = duckdb.sql('select * from values (1, 4), (1, 2), (2, 3), (2, 4) df(a, b)')
df = nw.from_native(rel)
df.select(nw.sum_horizontal(1, 'a', 'b'))throws
InvalidIntoExprError: Expected an object which can be converted into an expression, got <class 'int'>
Hint:
- if you were trying to select a column which does not have a string
column name, then you should explicitly use `nw.col`.
For example, `df.select(nw.col(0))` if you have a column named `0`.
- if you were trying to create a new literal column, then you
should explicitly use `nw.lit`.
For example, `df.select(nw.lit(0))` if you want to create a new
column with literal value `0`.I think we should have a way of allowing for anything which can't be parsed as an expression to be parsed as nw.lit in these cases
Reactions are currently unavailable