List of records is not transformed into a table if record fields are not all in the same order #11646
Open
Description
Describe the bug
If a nushell pipeline returns a list of records and all records contain the same fields in the same order, it will be transformed into a table (describe will return table<fields>
. However if there is any mismatch in the ordering of the fields (even if the fields are the same) then reported type will be list<any>
How to reproduce
- Run
seq 1 10
| par-each {|x|
[[version patch]; ['1.0.0' false] ['3.0.1' true] ['2.0.0' false]]
# | shuffle
| transpose -i -r -d
}
| describe
- Notice the reported type is
table<1.0.0: bool, 3.0.1: bool, 2.0.0: bool> (stream)
- Uncomment the shuffle step and rerun the code
- Notice the reported type is
list<any> (stream)
Expected behavior
I expected nu to consistently convert list of records to table
Screenshots
No response
Configuration
key | value |
---|---|
version | 0.89.0 |
branch | |
commit_hash | |
build_os | linux-x86_64 |
build_target | x86_64-unknown-linux-gnu |
rust_version | rustc 1.75.0 (82e1608df 2023-12-21) |
rust_channel | stable-x86_64-unknown-linux-gnu |
cargo_version | cargo 1.75.0 (1d8b05cdd 2023-11-20) |
build_time | 2024-01-10 11:03:39 +01:00 |
build_rust_channel | release |
allocator | mimalloc |
features | dataframe, default, extra, sqlite, trash, which, zip |
installed_plugins | from eml, from hcl, from ics, from ini, from tf, from vcf, gstat, inc, net, query, query json, query web, query xml |
Additional context
No response