Visidata: VisiData only recognizes keys present in the first object of JSON/YAML lists

Created on 25 Apr 2020  路  3Comments  路  Source: saulpw/visidata

Small description

As described in issue title; details below.

Expected result

VisiData should render all key-value information for top-level JSON/YAML dicts.

Actual result with screenshot

See below.

Steps to reproduce with sample data and a .vd

Command: vd https://raw.githubusercontent.com/simonw/museums/master/museums.yaml -f yaml

Compare the keys for the VisiData-loaded sheet vs. the keys in the second item in the YAML file. It seems that VisiData checks only the first item in a JSON/YAML list before determining the columns for the entire sheet. To me, that's unexpected and has, a few times, given me an incorrect impression of the data in a file.

Ideally, these loaders would, as they iterated through a file, append columns to the sheet as they encountered new keys.

Additional context

v2.-4dev, revision 96e5ab66 (Sunday, April 19)

bug fixed

Most helpful comment

I can take a look at this. I ran into similar behavior when expanding columns, so the changes from #497 could be useful as a reference here.

All 3 comments

I can take a look at this. I ran into similar behavior when expanding columns, so the changes from #497 could be useful as a reference here.

@ajkerrigan @jsvine Can this be closed? =)

Yes, thanks! And my apologies: I appear to have been mistaken re. the JSON aspect. Thank you both!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cbrueffer picture cbrueffer  路  12Comments

kovasap picture kovasap  路  13Comments

aborruso picture aborruso  路  12Comments

qrkourier picture qrkourier  路  16Comments

suntzuisafterU picture suntzuisafterU  路  11Comments