RandomFractals / vscode-data-preview

Data Preview 🈸 extension for importing 📤 viewing 🔎 slicing 🔪 dicing 🎲 charting 📊 & exporting 📥 large JSON array/config, YAML, Apache Arrow, Avro, Parquet & Excel data files
https://marketplace.visualstudio.com/items?itemName=RandomFractalsInc.vscode-data-preview
Apache License 2.0
541 stars 58 forks source link

Data missing in some columns in JSON preview #292

Closed CherryDT closed 1 year ago

CherryDT commented 2 years ago

See screenshot: image

As you can see, the phone and ctecId columns are missing their data in the preview.

This is the JSON data:

[
  {
    "prontoId": 0,
    "email": "aaa@aaa.com"
  },
  {
    "prontoId": 1,
    "email": "bbb@bbb.com"
  },
  {
    "prontoId": 2,
    "email": "ccc@ccc.com",
    "phone": "1234567890",
    "ctecId": "A123456"
  },
  {
    "prontoId": 3,
    "email": "ddd@ddd.com",
    "phone": "0987654321",
    "ctecId": "A654321"
  },
  {
    "prontoId": 4,
    "email": "eee@eee.com"
  },
  {
    "prontoId": 5,
    "email": "fff@fff.com",
    "phone": "1112223333"
  }
]
RandomFractals commented 1 year ago

This is related to #238 and is because your first two data entries in that json array doesn't have phone or ctecId properties.

if you add blanks there, it should work. Data preview doesn't scan random rows or first 10 or 100 rows to infer table columns yet.

Columns are determined by the first record in your dataset and it's important that you have all the properties and correct types in your first record.

CherryDT commented 1 year ago

Hm, what you say doesn't make sense though, because the columns are displayed... just empty.

RandomFractals commented 1 year ago

@CherryDT have you tried adding those missing properties with empty string values?

CherryDT commented 1 year ago

Yes it works then.

But what I mean is this: If the columns are based on what's in the first record, then why are phone and ctecId displayed as columns nonetheless? Even more interestingly, it seems like there are even types deferred somehow, because phone is shown as number type on the left sidebar...

If the columns simply weren't there, it would be clearer what's going on...

RandomFractals commented 1 year ago

that is the current limitation and since I'll be updating some of the dependencies in this extension soon, I don't think it's worthwhile to dig in deeper here.

So, I am going to close this for now. Just make sure all your records have the property fields you'd like to view and filter.

lyons-g commented 1 year ago

Hi, when you say you'll be updating some of the dependencies soon, will this limitation be addressed?

RandomFractals commented 1 year ago

Hi, when you say you'll be updating some of the dependencies soon, will this limitation be addressed?

yes. I am currently working on new duckdb tools, and plan to get back to data preview in March/April.

lyons-g commented 1 year ago

Hi, when you say you'll be updating some of the dependencies soon, will this limitation be addressed?

yes. I am currently working on new duckdb tools, and plan to get back to data preview in March/April.

Great - thanks for the reply