Skip to content

Conversation

@cosineblast
Copy link
Contributor

@cosineblast cosineblast commented Nov 22, 2024

Description

This pull requests implements a new partition-by chunk-by command. The operation takes a closure and partitions the input list into sublists based on the return value of the closure.

Examples, tests and and documentation were added accordingly.

image

image

@WindSoilder
Copy link
Contributor

Hi, thank you for the contribution!
Would you please resolve clippy errors first?

@devyn
Copy link
Contributor

devyn commented Nov 23, 2024

I think this is a good addition but I think the Rust name (would be chunk-by) for this operation is much better: https://doc.rust-lang.org/std/primitive.slice.html#method.chunk_by

Plus we already have the chunks command so I think it kind of goes well with that

Copy link
Member

@IanManske IanManske left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! Just some notes:

@cosineblast cosineblast changed the title Implement partition-by operation Implement chunk_by operation Nov 29, 2024
Copy link
Member

@IanManske IanManske left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR and all the fixes! Merging 🚀

@IanManske IanManske merged commit dc9e816 into nushell:main Nov 29, 2024
13 checks passed
@github-actions github-actions bot added this to the v0.101.0 milestone Nov 29, 2024
@fdncred fdncred added deprecated:pr-commands (deprecated: too vague) This PR changes our commands in some way notes:mention Include the release notes summary in the "Hall of Fame" section labels Nov 30, 2024
@cosineblast cosineblast deleted the partition-by branch February 17, 2025 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deprecated:pr-commands (deprecated: too vague) This PR changes our commands in some way notes:mention Include the release notes summary in the "Hall of Fame" section

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a non-reordering group-by operation

5 participants