fix(group-by): re #14337 name collision prevention#14360
Merged
fdncred merged 12 commits intonushell:mainfrom Nov 17, 2024
Merged
fix(group-by): re #14337 name collision prevention#14360fdncred merged 12 commits intonushell:mainfrom
fdncred merged 12 commits intonushell:mainfrom
Conversation
fdncred
reviewed
Nov 16, 2024
- Column names are only used for `--to-table` output, and should only be needed then. - Remove the current collision checking, replace later.
Member
Author
|
Updated error messages ❯ ls | rename items | group-by items --to-table❯ ls | rename closure_0 | group-by {get type} closure_0 --to-table |
Contributor
|
Thanks for working on this! |
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
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.
A more involved solution to the issue pointed out here
Description
With
--to-tablecell-path groupers are used to create column names, similar to
selectclosure groupers result in columns named
closure_{i}whereiis the index of argument, with regards to other closures i.e. first closure grouper results in a column namedclosure_0Previously
group-by foo {...} {...}=>table<foo, group1, group2, items>group-by {...} foo {...}=>table<group0, foo, group2, items>With this PR
group-by foo {...} {...}=>table<foo, closure_0, closure_1, items>group-by {...} foo {...}=>table<closure_0, foo, closure_1, items>no grouper argument results in a
table<group, items>as previouslyOn naming conflicts caused by cell-path groupers named
itemsorclosure_{i}, an error is thrown, suggesting to use a closure in place of a cell-path.And following the suggestion: