Visidata: Sqlite editing - delete row - NameError on commit-sheet

Created on 22 May 2020  ·  2Comments  ·  Source: saulpw/visidata

When I delete a row in a sqlite file and try to save z ^S to commit-sheet, I get a NameError: free variable 'row' referenced before assignment in enclosing scope. Appending a row or updating a row works as expected.

I am testing the current HEAD of the develop branch (d21918247df128027f1fa661ed43f4177bb037ca). See #564 for background.

image

Steps to reproduce with sample data and a .vd
Make a local copy of the visidata/sample_data/employees.sqlite file and run

sheet   col row longname    input   keystrokes  comment
    SqliteSheet header  set-option  0       
    UsvSheet    delimiter   set-option  ␞       
    UsvSheet    row_delimiter   set-option  ␟       
            open-file   employees.sqlite    o   
employees   name    キemployees.dept release-mouse       BUTTON1_RELEASED    slide current row/column to mouse cursor release position
employees       キemployees.emp  dive-row        ^J  open sheet with copies of rows referenced in current row
employees.emp       キ7934   delete-row      d   delete (cut) current row and move it to clipboard
employees.emp           commit-sheet        z^S 
bug fixed

Most helpful comment

@anjakefala, it works now. Thanks for the quick fix. Visidata is awesome and I appreciate all the work you all have done to create it.

All 2 comments

Interesting! I wonder how that got missed. Should be fixed now. =)

Thanks for the bug report!

@anjakefala, it works now. Thanks for the quick fix. Visidata is awesome and I appreciate all the work you all have done to create it.

Was this page helpful?
0 / 5 - 0 ratings