-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Construct cell paths programmatically #7337
Copy link
Copy link
Closed
Labels
category:bugSomething isn't workingSomething isn't workingcategory:enhancementNew feature or requestNew feature or request
Milestone
Description
Related problem
It is currently impossible to update/insert/upsert a nested path from a variable:
let p = 'ls.use_ls_colors'
$env.config | upsert $p false
Nushell treats $p as a string and instead of setting $env.config.ls.use_ls_colors, it ads a new entry $env.config.'ls.use_ls_colors'. This is also a bug because you shouldn't be allowed to have . as a column name.
Describe the solution you'd like
- IMO, the first parameter to
update/insert/upsert(and possibly other relevant commands) should auto-convert the string into a nested cell paths. - Another option would be to add
into cell-pathcommand that would do the same, and you'd have to callupsert ($p | into cell-path) false.
The options are not mutually exclusive. Either way, the bug that . can appear as a column name should be fixed.
Describe alternatives you've considered
No response
Additional context and details
| key | value |
|---|---|
| version | 0.72.1 |
| branch | main |
| commit_hash | 850ecf6 |
| build_os | linux-x86_64 |
| build_target | x86_64-unknown-linux-gnu |
| rust_version | rustc 1.65.0 (897e37553 2022-11-02) |
| rust_channel | 1.65.0-x86_64-unknown-linux-gnu |
| cargo_version | cargo 1.65.0 (4bc8f24d3 2022-10-20) |
| pkg_version | 0.72.1 |
| build_time | 2022-12-03 12:09:09 +02:00 |
| build_rust_channel | release |
| features | database, dataframe, default, trash, which, zip |
| installed_plugins | gstat |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
category:bugSomething isn't workingSomething isn't workingcategory:enhancementNew feature or requestNew feature or request