Daft
Daft copied to clipboard
[FEAT] eval expressions for List Types
We would like to eval expressions on list types. Treating each row of the list type as a series itself.
The first phase could be cardinality preserving expressions like this
df = daft.from_pydict({'x': [[1, 2], [3, 4, 5]]})
╭─────────────╮
│ x │
│ --- │
│ List[Int64] │
╞═════════════╡
│ [1, 2] │
├╌╌╌╌╌╌╌╌╌╌╌╌╌┤
│ [3, 4, 5] │
╰─────────────╯
df.select(df['x'].list.eval(col('item') + 1))
╭─────────────╮
│ x │
│ --- │
│ List[Int64] │
╞═════════════╡
│ [2, 3] │
├╌╌╌╌╌╌╌╌╌╌╌╌╌┤
│ [4, 5, 6] │
╰─────────────╯
@nsalerni Let me know if this is what you had in mind!
Closing this in favor of #2913