Daft icon indicating copy to clipboard operation
Daft copied to clipboard

[FEAT] eval expressions for List Types

Open samster25 opened this issue 1 year ago • 1 comments

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]   │
╰─────────────╯

samster25 avatar Mar 06 '24 06:03 samster25

@nsalerni Let me know if this is what you had in mind!

samster25 avatar Mar 06 '24 06:03 samster25

Closing this in favor of #2913

jaychia avatar Sep 25 '24 19:09 jaychia