drop column
when given a record always produces an empty record instead of either erroring or deleting a column
#6846
Labels
inconsistent-behavior
Behavior between different commands or types inconsistent/unexpected
semantics
Places where we should define/clarify nushell's semantics
type-system
Problems or features related to nushell's type system
Milestone
Describe the bug
As I understand it, records are "1-row data structures", which means every key is a column and every value is an element in that column. However, with that understanding,
drop column
doesn't work with it. It always returns a{record 0 items}
instead of either erroring or dropping a column (a key).How to reproduce
Expected behavior
I actually think this would make sense if it errored, because records are technically not ordered structures ("technically" in the sense that most programming languages, including JavaScript, do have a specification-defined algorithm for what happens when you iterate over a record's items) so referring to record columns by number is arguably invalid, and you should use
reject
instead. However, I can see an argument for permitting it anyway.Screenshots
No response
Configuration
Additional context
No response
The text was updated successfully, but these errors were encountered: