Commit 607a9c7
authored
Prevent
## References
Fixes nushell#11791
## Release notes summary - What our users need to know
Previously `detect columns` created records (rows) with duplicate key
names under some circumstances. The resulting table behaved
inconsistently with different commands.
Example:
```nushell
let data = "meooooow cat\nkitty kitty woof"
$data | detect columns
# => ╭───┬──────────┬───────╮
# => │ # │ meooooow │ cat │
# => ├───┼──────────┼───────┤
# => │ 0 │ kitty │ kitty │
# => ╰───┴──────────┴───────╯
$data | detect columns | get 0.cat
# => woof
```
Now it will result in an error suggesting using `detect columns --guess`
or `parse`
## Tasks after submitting
<!-- Remove any tasks which aren't relevant for your PR, or add your own
-->
- [ ] Update the
[documentation](https://github.com/nushell/nushell.github.io)detect columns from creating invalid records with duplicate keys (nushell#16527)1 parent e15e3ec commit 607a9c7
File tree
3 files changed
+33
-2
lines changed- crates
- nu-command
- src/strings
- tests/commands
- nu-protocol/src/errors/shell_error
3 files changed
+33
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
237 | 237 | | |
238 | 238 | | |
239 | 239 | | |
| 240 | + | |
240 | 241 | | |
241 | 242 | | |
242 | 243 | | |
| |||
311 | 312 | | |
312 | 313 | | |
313 | 314 | | |
314 | | - | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
315 | 324 | | |
316 | 325 | | |
317 | | - | |
| 326 | + | |
318 | 327 | | |
| 328 | + | |
319 | 329 | | |
320 | 330 | | |
321 | 331 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
667 | 667 | | |
668 | 668 | | |
669 | 669 | | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
670 | 684 | | |
671 | 685 | | |
672 | 686 | | |
| |||
0 commit comments