nushell icon indicating copy to clipboard operation
nushell copied to clipboard

nu-table: Improve `table -a`

Open zhiburt opened this issue 1 year ago • 1 comments

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 avatar Feb 20 '24 00:02 zhiburt

@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

fdncred avatar Feb 20 '24 12:02 fdncred

@zhiburt something about these tests isn't quite right. any ideas?

fdncred avatar Feb 23 '24 13:02 fdncred

definitely closer.

fdncred avatar Feb 23 '24 16:02 fdncred

Don't forget to squash commits.

Yes I was not sure about -a 0 and made it return empty result.

zhiburt avatar Feb 23 '24 17:02 zhiburt

thanks again @zhiburt!

fdncred avatar Feb 23 '24 18:02 fdncred

@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?

fdncred avatar Feb 23 '24 18:02 fdncred

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

zhiburt avatar Feb 24 '24 00:02 zhiburt

Thanks!

fdncred avatar Feb 24 '24 01:02 fdncred