feat(rust,python): add dedicated name
namespace for operations that affect expression names
#11973
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.
Closes #11639.
As per discussion on the linked issue, this PR moves the following name-related expressions into a dedicated/new
name
namespace in Python and creates an equivalent namespace in Rust where these related expressions (and any future ones) can live:Moved
keep_name()
→name.keep()
map_alias()
→name.map()
prefix()
→name.prefix()
suffix()
→name.suffix()
New
Now that the dedicated namespace exists (so there will be no confusion with the equivalent
str.to_*
methods), have also added the following new expressions:name.to_lowercase()
name.to_uppercase()
Deprecation
keep_name
,suffix
,prefix
,map_alias
; existing code will need to be updated to point at the relocated expressions in the newname
expressions.Misc
name
namespace docs and tests, updated examples & user guide, etc.polars-plan/dsl
; moved the one-line entry for COUNT into "consts" instead.