-
Notifications
You must be signed in to change notification settings - Fork 2.5k
refactor: Make Selector a concrete part of the DSL
#23351
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
coastalwhite
merged 46 commits into
pola-rs:main
from
coastalwhite:refactor/selector-try-2
Jul 8, 2025
Merged
refactor: Make Selector a concrete part of the DSL
#23351
coastalwhite
merged 46 commits into
pola-rs:main
from
coastalwhite:refactor/selector-try-2
Jul 8, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0a37716 to
abb9003
Compare
Selector concrete DSL partSelector a concrete part of the DSL
This basically makes the expression expansion into one function and moves the
items that are not expansion (e.g. `name.keep`, `name.map`,
`struct.field[int]`) into the DSL to IR conversion. This makes both a lot
cleaner and simpler.
This also introduces:
- `cs.empty()`
- `cs.list()`
- `cs.array()`
- `cs.struct()`
- `cs.enum()`
- `name.keep` and `name.{map, prefix, suffix, ...}` can now be used multiple
times in succession.
TODO:
- [ ] Gate the expr_expansion behind actually having stuff that needs to get expanded.
- [ ] Docs for new functions
- [ ] Clean Up
This was referenced Jul 8, 2025
jqnatividad
added a commit
to dathere/qsv
that referenced
this pull request
Jul 9, 2025
as pola-rs/polars#23351 has breaking API changes
This was referenced Jul 11, 2025
2 tasks
This was referenced Jul 22, 2025
2 tasks
2 tasks
75 tasks
jqnatividad
added a commit
to dathere/qsv
that referenced
this pull request
Aug 3, 2025
as Selector is now a concrete part of the DSL see pola-rs/polars#23351
schmidma
added a commit
to schmidma/great-tables
that referenced
this pull request
Sep 1, 2025
Polars replaced `_selector_proxy_` with a public `Selector` class (pola-rs/polars#23351). This caused type checking imports to fail. This updates the type annotation import and alias accordingly.
2 tasks
4 tasks
This was referenced Oct 23, 2025
Open
2 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Note
TLDR
Selectors are reimplemented to be more reliable and easier to maintain and expand in the future. This brings many improvements, such as being able to chain
.nameexpressions, all selectors being able to be combined and several new datatype selectors.This basically makes the expression expansion into one function and moves the items that are not expansion (e.g.
name.keep,name.map,struct.field[int]) into the DSL to IR conversion. This makes both a lot cleaner and simpler. Expressions containing multiple selectors will now generally always follow the rule(n, n) -> nor(1, n) -> n.This also introduces:
cs.empty()cs.list()cs.array()cs.struct()cs.enum()name.keepandname.{map, prefix, suffix, ...}can now be used multiple times in succession.Fixes #10782.
Fixes #10594.
Fixes #21174.
Fixes #21164.
Fixes #14059.
Fixes #13858.
Fixes #12850.
Fixes #8282.
Fixes #19023.
Fixes #19384.
Fixes #21352.
Fixes #22200.
Fixes #11067.
Fixes #11425.
Fixes #22955.