|
1 | | -"""Brainstorming an `Expr` internal representation. |
2 | | -
|
3 | | -Notes: |
4 | | -- Each `Expr` method should be representable by a single node |
5 | | - - But the node does not need to be unique to the method |
6 | | -- A chain of `Expr` methods should form a plan of operations |
7 | | -- We must be able to enforce rules on what plans are permitted: |
8 | | - - Must be flexible to both eager/lazy and individual backends |
9 | | - - Must be flexible to a given context (select, with_columns, filter, group_by) |
10 | | -- Nodes & plans are: |
11 | | - - Immutable, but |
12 | | - - Can be extended/re-written at both the Narwhals & Compliant levels |
13 | | - - Introspectable, but |
14 | | - - Store as little-as-needed for the common case |
15 | | - - Provide properties/methods for computing the less frequent metadata |
16 | | -
|
17 | | -References: |
18 | | -- https://github.com/pola-rs/polars/blob/dafd0a2d0e32b52bcfa4273bffdd6071a0d5977a/crates/polars-python/src/lazyframe/visitor/expr_nodes.rs |
19 | | -- https://github.com/pola-rs/polars/blob/dafd0a2d0e32b52bcfa4273bffdd6071a0d5977a/crates/polars-plan/src/dsl/expr.rs |
20 | | -- https://github.com/pola-rs/polars/blob/dafd0a2d0e32b52bcfa4273bffdd6071a0d5977a/crates/polars-plan/src/dsl/function_expr/mod.rs |
21 | | -- https://github.com/pola-rs/polars/blob/dafd0a2d0e32b52bcfa4273bffdd6071a0d5977a/crates/polars-plan/src/dsl/options/mod.rs#L137-L172 |
22 | | -- https://github.com/pola-rs/polars/blob/3fd7ecc5f9de95f62b70ea718e7e5dbf951b6d1c/crates/polars-plan/src/plans/options.rs#L35-L106 |
23 | | -- https://github.com/pola-rs/polars/blob/3fd7ecc5f9de95f62b70ea718e7e5dbf951b6d1c/crates/polars-plan/src/plans/options.rs#L131-L236 |
24 | | -- https://github.com/pola-rs/polars/blob/3fd7ecc5f9de95f62b70ea718e7e5dbf951b6d1c/crates/polars-plan/src/plans/options.rs#L240-L267 |
25 | | -- https://github.com/pola-rs/polars/blob/6df23a09a81c640c21788607611e09d9f43b1abc/crates/polars-plan/src/plans/aexpr/mod.rs |
26 | | -
|
27 | | -Related: |
28 | | -- https://github.com/narwhals-dev/narwhals/pull/2483#issuecomment-2866902903 |
29 | | -- https://github.com/narwhals-dev/narwhals/pull/2483#issuecomment-2867331343 |
30 | | -- https://github.com/narwhals-dev/narwhals/pull/2483#issuecomment-2867446959 |
31 | | -- https://github.com/narwhals-dev/narwhals/pull/2483#issuecomment-2869070157 |
32 | | -- (https://github.com/narwhals-dev/narwhals/pull/2538/commits/a7eeb0d23e67cb70e7cfa73cec2c7b69a15c8bef#r2083562677) |
33 | | -- https://github.com/narwhals-dev/narwhals/issues/2225 |
34 | | -- https://github.com/narwhals-dev/narwhals/issues/1848 |
35 | | -- https://github.com/narwhals-dev/narwhals/issues/2534#issuecomment-2875676729 |
36 | | -- https://github.com/narwhals-dev/narwhals/issues/2291 |
37 | | -- https://github.com/narwhals-dev/narwhals/issues/2522 |
38 | | -- https://github.com/narwhals-dev/narwhals/pull/2555 |
39 | | -""" |
40 | | - |
41 | 1 | from __future__ import annotations |
0 commit comments