nu-table: Improve `table -a`
Hi there;
Sorry took that long to respond.
I guess it's good? It will consume the whole stream whether possible. I do believe it will be faster in WSL in general too (in a sense of whole buffer output), but its interesting issue probably needed to be separated. It was not very well explained as well.
> 0..2000 | table -a 2
╭───┬──────╮
│ 0 │ 0 │
│ 1 │ 1 │
│ 2 │ ... │
│ 3 │ 1999 │
│ 4 │ 2000 │
╰───┴──────╯
Take care
fix: #11845
cc: @fdncred
@zhiburt for some reason this is breaking ci with things like these. Any ideas what's going on?
test commands::table::table_abbreviation has been running for over 60 seconds
test commands::table::table_abbreviation_by_config has been running for over 60 seconds
@zhiburt something about these tests isn't quite right. any ideas?
definitely closer.
Don't forget to squash commits.
Yes I was not sure about -a 0 and made it return empty result.
thanks again @zhiburt!
@zhiburt one more question. i just want to make sure this stream collect is only being called with -a, we don't want to be collecting on other table modes. can you confirm that is correct?
i just want to make sure this stream collect is only being called with -a, we don't want to be collecting on other table modes. can you confirm that is correct?
Correct
https://github.com/nushell/nushell/blob/73266eaeef5f57c3f3bd1f81c7330bc447b73d42/crates/nu-command/src/viewers/table.rs#L800-L810
Thanks!