Skip to content

Can't convert a 'string' to a 'column'  #2979

@djvsrose

Description

@djvsrose

ls | select name
let column_name = "name"; ls | select $column_name => this will not work. expected column path, found string
ls | get $(= name). => This will not work either

There's no way to convert a string to a column path. This makes it very difficult to manipulate a table from a script.

> version | pivot
───┬────────────────────┬─────────────────────────────────────────────────────────────────────────────────────────────────────────
 # │      Column0       │                                                 Column1                                                 
───┼────────────────────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────
 0 │ version            │ 0.25.1                                                                                                  
 1 │ build_os           │ macos-x86_64                                                                                            
 2 │ rust_version       │ rustc 1.48.0                                                                                            
 3 │ cargo_version      │ cargo 1.48.0                                                                                            
 4 │ pkg_version        │ 0.25.1                                                                                                  
 5 │ build_time         │ 2021-01-06 16:50:40                                                                                     
 6 │ build_rust_channel │ release                                                                                                 
 7 │ features           │ ctrlc, default, directories, dirs, git, ichwh, ptree, rich-benchmark, rustyline, term, uuid, which, zip 
───┴────────────────────┴─────────────────────────────────────────────────────────────────────────────────────────────────────────

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions