Skip to content
Merged
Show file tree
Hide file tree
Changes from 98 commits
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
9df31dc
refactor: Split up selectors
dangotbanned Oct 22, 2025
f44e015
refactor: Separate `DTypeSelector`
dangotbanned Oct 22, 2025
b57bb10
oops missed one!
dangotbanned Oct 22, 2025
e17d18b
feat(DRAFT): Re/implement `By{Index,Name}`, `into_columns`
dangotbanned Oct 22, 2025
11489b3
chore: More planning
dangotbanned Oct 22, 2025
f9be688
test: Start porting some upstream tests
dangotbanned Oct 23, 2025
67d7eb4
test: Restructure tests
dangotbanned Oct 23, 2025
14b891f
test: Port `by_index` tests
dangotbanned Oct 23, 2025
5158d94
test(DRAFT): Add placeholders for everything that looks interesting
dangotbanned Oct 23, 2025
18b4a22
test: Port port port
dangotbanned Oct 23, 2025
a032f49
test: 4x more
dangotbanned Oct 23, 2025
e93dc46
test: Add `test_selector_result_order`
dangotbanned Oct 23, 2025
5d60906
cov temp
dangotbanned Oct 23, 2025
e733dbc
test: oh nice, this already works!
dangotbanned Oct 23, 2025
2f66d16
test: More `by_name` tests
dangotbanned Oct 23, 2025
bde633a
fix: Validate selectors inputs more
dangotbanned Oct 23, 2025
632de2e
fix: Allow empty `by_dtype`
dangotbanned Oct 23, 2025
198b296
fix: Re-align selector binary ops w/ polars
dangotbanned Oct 23, 2025
db4e331
test(typing): Silence unfixable ignore
dangotbanned Oct 23, 2025
f493c72
test: All of `test_selector_sets` works!
dangotbanned Oct 24, 2025
e5dd9e0
test: All of `test_selector_datetime` works too!
dangotbanned Oct 24, 2025
9df5700
test: `parametrize` big `datetime` test
dangotbanned Oct 24, 2025
e502e73
fix: Actually check the inner dtype for `cs.{list,array}` 🤦‍♂️
dangotbanned Oct 24, 2025
21ef672
fix: Ensure `DTypeSelector` only nests other `DTypeSelector`s
dangotbanned Oct 24, 2025
35f8bac
feat(DRAFT): Roughly add all the new concepts
dangotbanned Oct 24, 2025
66b2501
fix: Swap implementation of `expand_selector_irs_names`
dangotbanned Oct 24, 2025
4e3433d
refactor(DRAFT): Integrating concrete `Selector` in expansion
dangotbanned Oct 24, 2025
f83c79b
refactor: Unravelling `expand_expression_by_combination` part 1
dangotbanned Oct 25, 2025
74a200f
refactor: Unravelling `expand_expression_by_combination` part 2
dangotbanned Oct 25, 2025
debf883
refactor: Fill out the `FunctionExpr` parts too
dangotbanned Oct 25, 2025
4a8dc31
chore: Housekeeping
dangotbanned Oct 25, 2025
5db6d57
chore: Align some more reprs
dangotbanned Oct 25, 2025
34b51a8
oooh missed a spot
dangotbanned Oct 25, 2025
814d4f8
tidy
dangotbanned Oct 25, 2025
961a5f4
fix: Ensure selectors reduce in predicates
dangotbanned Oct 26, 2025
1c0d059
just keep swimming
dangotbanned Oct 26, 2025
b96dfd7
disallow multi-output in `when` (for now)
dangotbanned Oct 27, 2025
53cc24e
tweak that error message
dangotbanned Oct 27, 2025
8c69f13
fix: Ensure exprs are ordered for grouping in error
dangotbanned Oct 27, 2025
3747155
feat(DRAFT): Huge simplify, remove fiddly leaf/root zip expansion
dangotbanned Oct 27, 2025
9047af6
refactor: Remove more complexity
dangotbanned Oct 27, 2025
2499b88
test: Add failing tests for new `name` behaviors
dangotbanned Oct 27, 2025
2cfd725
feat: Allow multiple `name` ops
dangotbanned Oct 27, 2025
303d091
fix: Get `KeepName` working
dangotbanned Oct 27, 2025
f1a8d0d
test: All of `selectors_test` passes!!!!! 🥳🥳🥳🥳🥳
dangotbanned Oct 27, 2025
d478420
refactor: Use new selectors in `_rewrites`
dangotbanned Oct 28, 2025
7b31d65
refactor: (Partially) Use new selectors in `group_by`
dangotbanned Oct 28, 2025
d7654e1
Use new selectors in `DataFrame.filter`, fix `''` output name
dangotbanned Oct 28, 2025
d572f0a
refactor: Use new selectors in `DataFrame.sort`
dangotbanned Oct 28, 2025
b2124e0
refactor: Use new selectors in `DataFrame.with_columns`
dangotbanned Oct 28, 2025
03bc5e8
test: Flesh-out `Frame` util some more
dangotbanned Oct 28, 2025
439ebf5
test: Use new selectors in most of `expr_expansion_test`
dangotbanned Oct 28, 2025
1321c21
test: Finish `expr_expansion_test` transition
dangotbanned Oct 28, 2025
75065ca
refactor: Use new selectors in `DataFrame.select`
dangotbanned Oct 28, 2025
952f70d
refactor: Remove a whole bunch of old selectors
dangotbanned Oct 28, 2025
c4a9cea
refactor: Remove `Nth`, `IndexColumns`, `Exclude`
dangotbanned Oct 28, 2025
3ae9a7b
refactor: Remove `Columns`
dangotbanned Oct 28, 2025
ef7ba4e
refactor: Remove `All`, `_ColumnSelection`
dangotbanned Oct 28, 2025
b926152
tidy tidy tidy
dangotbanned Oct 28, 2025
5cdb984
fix: Always ignore for `group_by`
dangotbanned Oct 28, 2025
9f96467
okay what errors?
dangotbanned Oct 28, 2025
f16603d
ci: Fix `check_docstrings`
dangotbanned Oct 28, 2025
b7a5d30
perf: Re-introduce cache for `DTypeSelector`s
dangotbanned Oct 29, 2025
273454c
fix(typing): Widen `ByDType._matches`
dangotbanned Oct 29, 2025
0094bbc
fix: Create and handle more selectors edge cases
dangotbanned Oct 29, 2025
3e84d9c
chore: remove outdated comment
dangotbanned Oct 29, 2025
677be9f
exclude
dangotbanned Oct 29, 2025
a9493ad
docs: restore, adapt old doc
dangotbanned Oct 29, 2025
7c42f78
fix(typing): update ignore
dangotbanned Oct 29, 2025
271389b
refactor: Remove `_s` suffixes
dangotbanned Oct 29, 2025
303efd7
perf: Make `needs_expansion` a method
dangotbanned Oct 29, 2025
bf25c9a
refactor: Structure around `Expander`
dangotbanned Oct 29, 2025
9b2f617
`resolve_names` -> `Expander.prepare_projection`
dangotbanned Oct 29, 2025
936c78b
chore: planning fancy binary combination expansion
dangotbanned Oct 29, 2025
d09aa74
adapt old `BinaryExpr` tests and make them fail
dangotbanned Oct 29, 2025
fbb1c8e
feat: Allow multi-output `Expr` on either or both* sides of a binary op
dangotbanned Oct 30, 2025
d60a32e
feat: Re-introduce error, display shape mismatch
dangotbanned Oct 30, 2025
ebe8fc8
revert: temp change `sum`
dangotbanned Oct 30, 2025
9832de2
Update narwhals/_plan/expressions/selectors.py
dangotbanned Oct 30, 2025
2847cbb
chore: Remove dead code
dangotbanned Oct 30, 2025
d829677
test: Port over upstream `test_meta.py`
dangotbanned Oct 30, 2025
124706c
feat: Support `ncs.by_name("name").meta.output_name()`
dangotbanned Oct 30, 2025
e8eb22e
chore: More coverage, simplify
dangotbanned Oct 30, 2025
19ca6d3
chore: Fix `_expr_output_name` coverage
dangotbanned Oct 31, 2025
109537c
test: cover error in `meta.as_selector`
dangotbanned Oct 31, 2025
2a8212c
Merge branch 'expr-ir/over-and-over-and-over-again' into expr-ir/stri…
dangotbanned Nov 1, 2025
90104e6
chore(expr-ir): Improve coverage (#3265)
dangotbanned Nov 1, 2025
9de3552
Merge branch 'expr-ir/over-and-over-and-over-again' into expr-ir/stri…
dangotbanned Nov 2, 2025
1c5be8f
cov
dangotbanned Nov 2, 2025
a8f70d7
feat: Support `ncs.matches(re.Pattern[str])`
dangotbanned Nov 2, 2025
67e7918
feat: Add `ncs.{float,integer,temporal}`#
dangotbanned Nov 2, 2025
3557728
feat: Add `ncs.{first,last}`
dangotbanned Nov 2, 2025
d081ef9
chore: Re-order selectors in `expressions.expr`
dangotbanned Nov 2, 2025
ebf945a
chore: Add `_plan.selectors.__all__`
dangotbanned Nov 2, 2025
35047c7
chore: Simplify, test, stabilize `ByDType` repr
dangotbanned Nov 2, 2025
46bdd51
chore: Remove some bad docs
dangotbanned Nov 2, 2025
a826204
fix: Align `group_by` agg expansion with `polars`
dangotbanned Nov 2, 2025
2ba8edd
refactor: Rename, re-doc `into_columns` -> `iter_expand(_names)`
dangotbanned Nov 2, 2025
616a5d5
feat: Support `drop_nulls(OneOrIterable[ColumnNameOrSelector])`
dangotbanned Nov 2, 2025
9447959
feat: Support `drop(*columns: OneOrIterable[ColumnNameOrSelector])`
dangotbanned Nov 3, 2025
003972b
test: Fully cover selectors in `drop`
dangotbanned Nov 3, 2025
20ac1d3
cov
dangotbanned Nov 3, 2025
cc780de
refactor: Start transitioning `DataFrame.sort` to selectors-only
dangotbanned Nov 3, 2025
50bcb9c
refactor: Finish `sort_by_ir` removal
dangotbanned Nov 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ repos:
narwhals/.*typing\.py|
narwhals/_plan/functions\.py|
narwhals/_plan/expressions/ranges\.py|
narwhals/_plan/schema\.py
narwhals/_plan/schema\.py|
narwhals/_plan/expressions/selectors\.py
)
- id: pull-request-target
name: don't use `pull_request_target`
Expand Down
5 changes: 3 additions & 2 deletions narwhals/_plan/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from __future__ import annotations

from narwhals._plan import selectors
from narwhals._plan.dataframe import DataFrame
from narwhals._plan.expr import Expr, Selector
from narwhals._plan.expressions import selectors
from narwhals._plan.expr import Expr
from narwhals._plan.functions import (
all,
all_horizontal,
Expand All @@ -25,6 +25,7 @@
sum_horizontal,
when,
)
from narwhals._plan.selectors import Selector
from narwhals._plan.series import Series

__all__ = [
Expand Down
Loading
Loading