Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

undoing column additions causes IndexError in allAggregators #2607

Open
midichef opened this issue Nov 12, 2024 · 1 comment
Open

undoing column additions causes IndexError in allAggregators #2607

midichef opened this issue Nov 12, 2024 · 1 comment
Labels

Comments

@midichef
Copy link
Contributor

Small description
After adding a column, undoing the add causes an error.

Steps to reproduce
Open any visidata sheet, then i then U:
vd sample_data/sample.tsv

Expected result
The column insertion is undone, with normal status.

Actual result with screenshot
The column insertion is undone, but an error appears:

Traceback (most recent call last):
  File "/home/j/.venv/lib/python3.10/site-packages/visidata/mainloop.py", line 252, in mainloop
    vd.callNoExceptions(sheet.checkCursor)
...
  File "/home/midichef/.venv/lib/python3.10/site-packages/visidata/sheets.py", line 643, in checkCursor
    elif self.bottomRowIndex < self.cursorRowIndex:
...
  File "/home/midichef/.venv/lib/python3.10/site-packages/visidata/sheets.py", line 780, in allAggregators
    col = self.availCols[vcolidx]
IndexError: list index out of range

The error is probably related to caching. Clearing caches prevented the same traceback after hiding a column.

Configuration
visidata v3.2dev
Python 3.10.12

@midichef midichef added the bug label Nov 12, 2024
@midichef
Copy link
Contributor Author

Another way to trigger the same bug:

echo '{"A": [1, 2, 3]}' |vd -f json

then expand-col and contract-col

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant