Visidata: Can't add rows to a new Sheet in v.2.-1dev

Created on 19 Sep 2019  路  2Comments  路  Source: saulpw/visidata

Small description

ga command fails to add rows in a new Sheet

Steps to reproduce

  1. Launch vd
  2. Press Shift-a for a new Sheet (enter a number of columns for that sheet when asked, e.g. 2)
  3. Press ga to add some new rows (enter a number of columns for that sheet when asked, e.g. 10)

Below is the commandlog (saved with Ctrl-d) to show the steps that led to the issue:

sheet   col row longname    input   keystrokes  comment
            open-file   .   o   
            add-sheet   2   A   
unnamed         add-rows    10  ga

Expected result

With v.1.5.2, 10 rows would have been added.

Actual result with screenshot

With v.2.-1dev, vd reports AttributeError: 'Sheet' object has no attribute 'newRow' | "10".

Below is the full stack trace (saved with Ctrl-e):

Traceback (most recent call last):
   File "/Users/me/Library/Python/3.7/lib/python/site-packages/visidata/threads.py", line 197, in _toplevelTryFunc
     t.status = func(*args, **kwargs)
   File "/Users/me/Library/Python/3.7/lib/python/site-packages/visidata/data.py", line 53, in addRows
     sheet.addRow(sheet.newRow(), idx+1)
AttributeError: 'Sheet' object has no attribute 'newRow'
bug

Most helpful comment

@for-coursera :+1: Excellent bug report! It really helped me narrow in on the problem.

Most loaders/specialised sheets have their own newRow module implemented (e.g. https://github.com/saulpw/visidata/blob/develop/visidata/loaders/tsv.py#L111). However, the basic Sheet did not! This is why the issue only popped up when you created a new blank sheet. =)

Should be fixed now. Thanks!

All 2 comments

@for-coursera :+1: Excellent bug report! It really helped me narrow in on the problem.

Most loaders/specialised sheets have their own newRow module implemented (e.g. https://github.com/saulpw/visidata/blob/develop/visidata/loaders/tsv.py#L111). However, the basic Sheet did not! This is why the issue only popped up when you created a new blank sheet. =)

Should be fixed now. Thanks!

Do confirm, works for me after the upgrade.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

suntzuisafterU picture suntzuisafterU  路  3Comments

aborruso picture aborruso  路  3Comments

unhammer picture unhammer  路  3Comments

aborruso picture aborruso  路  3Comments

frosencrantz picture frosencrantz  路  3Comments