Repository navigation
Add uniq command - #1132
Add uniq command#1132
Conversation
|
The I think it should be a command. Agreed that because it's a fundamental table operation, it should be a command |
|
Very cool Ryan. Please check the Today it works both on values as well as rows. Perhaps you could support |
|
@jonathandturner I ended up using I added some documentation and I think this is almost ready to go. I'll try to mess around with how this behaves with nested data structures today and write a few more tests. |
|
@jonathandturner I've added a new fixture that sets up some very basic nested json along with some tests. |
|
There is still one lingering issue that I'd like to solve before merging this. Consider the following data structure: Currently, you can get around this with a pipeline like I think we can solve this by sorting the keys/columns in data structures before they are hashed, but I'll need to play around with it further. A number of tests need to be written for edge cases like this. |
…n more complicated
|
@jonathandturner I ended up doing what we discussed and sorted the Dictionary entries by key. The test |
|
Cool, looks good. Thanks! |
This PR adds a
uniqcommand to nushell. The usage of this command is similar touniqin Bash, except instead of filtering out repeated lines of text, it filters out repeated rows from the pipeline. The current implementation looks to be the only command that does not have optional parameters.References Issue: #956
Usage
Given file
test.csvCommand
open test.csv | uniqOutput
Command
open test.csv | pick rusty_at type | uniqOutput
Questions (all answered)
uniq, I can add them in this PR.wherecommand.TODO