Skip to content

Commit c203ef4

Browse files
committed
chore: Remove/update comments/notes
1 parent 8b9b8d3 commit c203ef4

File tree

8 files changed

+4
-63
lines changed

8 files changed

+4
-63
lines changed

narwhals/_plan/__init__.py

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1 @@
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-
411
from __future__ import annotations

narwhals/_plan/aggregation.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ class Std(Agg):
7272
__slots__ = (*Agg.__slots__, "ddof")
7373

7474
ddof: int
75-
"""https://github.com/narwhals-dev/narwhals/pull/2555"""
7675

7776

7877
class Sum(Agg): ...
@@ -82,7 +81,6 @@ class Var(Agg):
8281
__slots__ = (*Agg.__slots__, "ddof")
8382

8483
ddof: int
85-
"""https://github.com/narwhals-dev/narwhals/pull/2555"""
8684

8785

8886
class OrderableAgg(Agg): ...

narwhals/_plan/categorical.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ class GetCategories(CategoricalFunction):
1717

1818
@property
1919
def function_options(self) -> FunctionOptions:
20-
"""https://github.com/pola-rs/polars/blob/62257860a43ec44a638e8492ed2cf98a49c05f2e/crates/polars-plan/src/dsl/function_expr/cat.rs#L41."""
2120
return FunctionOptions.groupwise()
2221

2322
def __repr__(self) -> str:

narwhals/_plan/expr.py

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
"""Top-level `Expr` nodes.
2-
3-
Todo:
4-
- `Selector`
5-
- `Ternary`
6-
- `Window` (investigate variants)
7-
"""
1+
"""Top-level `Expr` nodes."""
82

93
from __future__ import annotations
104

@@ -489,10 +483,7 @@ class BinarySelector(
489483

490484

491485
class Ternary(ExprIR):
492-
"""When-Then-Otherwise.
493-
494-
Deferring this for now.
495-
"""
486+
"""When-Then-Otherwise."""
496487

497488
__slots__ = ("falsy", "predicate", "truthy")
498489

narwhals/_plan/functions.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
"""General functions that aren't namespaced.
2-
3-
Todo:
4-
- repr
5-
"""
1+
"""General functions that aren't namespaced."""
62

73
from __future__ import annotations
84

narwhals/_plan/meta.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
"""`pl.Expr.meta` namespace functionality.
22
3-
- It seems like there might be a need to distinguish the top-level nodes for iterating
4-
- polars_plan::dsl::expr::Expr
53
- https://github.com/pola-rs/polars/blob/dafd0a2d0e32b52bcfa4273bffdd6071a0d5977a/crates/polars-plan/src/dsl/meta.rs#L11-L111
64
- https://github.com/pola-rs/polars/blob/dafd0a2d0e32b52bcfa4273bffdd6071a0d5977a/crates/polars-plan/src/plans/iterator.rs#L10-L105
75
"""

narwhals/_plan/options.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ def aggregation() -> FunctionOptions:
115115
return FunctionOptions.groupwise().with_flags(FunctionFlags.RETURNS_SCALAR)
116116

117117

118-
# TODO @dangotbanned: Decide on constructors
119118
class SortOptions(Immutable):
120119
__slots__ = ("descending", "nulls_last")
121120

narwhals/_plan/selectors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""Deviations from `polars`.
22
33
- A `Selector` corresponds to a `nw.selectors` function
4-
- Binary ops are represented as a subtype of `BinaryExpr`
4+
- Binary ops are represented as a `BinarySelector`, similar to `BinaryExpr`.
55
"""
66

77
from __future__ import annotations

0 commit comments

Comments
 (0)