saulpw / visidata

A terminal spreadsheet multitool for discovering and arranging data
http://visidata.org
GNU General Public License v3.0
7.75k stars 276 forks source link

Sheets-Sheet sorting-problems #761

Closed klartext closed 3 years ago

klartext commented 3 years ago

Small description Opening the sheets-sheet of some .tsv or .tsv, then sorting columns does not work, or does work and closes sheets-sheet immediately afterwards. Behaviour differs between my set of .tsv and my set of .csv. Also not all column names show the same behaviour.

Expected result Sorting of sheet-sheets works as in any other sheet: data will be sorted with [ and ] and notheng else happens. Sheet will not be closed automatically.

Steps to reproduce with sample data and a .vd Different steps. Will add the vd-output in seperate comments later.

Just short description: for a bunch of *.tsv files I got the following behaviour:

Sheets-View:

Column "name":

[ for sort: sorts but jumps out of Sheets-view (wrong)
] for sort: sorts and view stays intact (good)

Column "nRows":

[ for sort: sorts and view stays intact (good)
] for sort: does not sort and leaves view (wrong)

Other Columns seem also to have problems.

Using a set of *,csv files I got the behaviour that for [ as well as ] the sheet-sheet closes (but sorting seems to work).

Version of VisiData: saul.pw/VisiData v2.0.1

klartext commented 3 years ago

I can't share my .tsv files, but we can use some public .csv files: https://github.com/CSSEGISandData/COVID-19/tree/master/csse_covid_19_data/csse_covid_19_time_series

sheet col row longname  input keystrokes  comment
      open-file Errata.csv  o
      open-file time_series_covid19_confirmed_global.csv  o
      open-file time_series_covid19_confirmed_US.csv  o
      open-file time_series_covid19_deaths_global.csv o
      open-file time_series_covid19_deaths_US.csv o
      open-file time_series_covid19_recovered_global.csv  o
Errata      sheets-stack    S open Sheets Stack: join or jump between the active sheets on the current stack
sheets  name    sort-desc   ] sort descending by current column; replace any existing sort criteria

Sheets-sheet will be closed immediately after the sort-command. (In this case sorting was successful, but as mentioned abouve, with my *.tsv files sorting not even worked always.)

anjakefala commented 3 years ago

Hi @klartext!

This is by design. =) See here for more detail about why this is happening: https://github.com/saulpw/visidata/issues/518

anjakefala commented 3 years ago

Thanks for writing such a comprehensive report about the situation!