Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign up`get` Command Produces Both Table And Error #2677
Comments
|
I'm guessing that this happens because not all
|
|
Ahh yeah, that makes sense to me. |
|
Opening files with same data but different format gives different results: test.json [
{ "a": 1, "b": 2 },
{ "a": 3 }
]
test.csv
Poweshell output: PS /Users/oskarskog/dev/src/nushell> Get-Content ./test.json | ConvertFrom-Json
a b
- -
1 2
3
PS /Users/oskarskog/dev/src/nushell> Get-Content ./test.csv | ConvertFrom-Csv
a b
- -
1 2
3Should we add columns to the rows that are missing them to keep the shape of the data consistent? |
|
@oskarskog You have to keep in mind that nu wants to stream data. We've had a lot of discussions about homogeneity as it relates to rows and columns. i.e. having the exact number of columns for any given csv file. In my mind, we can't really have homogeneous columns with csv files without (sometimes?) removing streaming because that would mean that we parse the entire csv file before outputting a single row in order to make sure we have enough columns for well-formed and malformed csv files. However, I would say that I think our csv handling should be more resilient. We'd love to have some contributors help with that resiliency. We're always open to suggestions. I haven't looked at get-content from PowerShell yet, nor do I know if PowerShell streams data but it would be an interesting investigation. Generally speaking, though, with your given tests above I'd like to have a similar output, I think. It seems like it would just be more consistent that way. For fun, I tested another data-centric shell on these files and it responds similar to nushell. I'm not saying any way is right or wrong. Just throwing another shell at the comparision.
|


Describe the bug
I was opening the main
.tomlfile in the project root when I discovered this. Using the command:open Cargo.toml | get bin | get required-features, produces both an output table, and an error:Expected behavior
I expect to see only the table and not the error.
Screenshots
If applicable, add screenshots to help explain your problem.
Configuration (please complete the following information):
versioncommand to find out): 0.21 (compiled from master)