Skip to content

[BUG] Can't render the data when the field values are indexed with numbers in the data object #94

@kjcho-msft

Description

@kjcho-msft

Issue:
When the data in outputs are indexed with numbers, data-explorer can't render the output correctly.

        "application/vnd.dataresource+json": {
          "schema": {
            "fields": [
              {
                "name": "name"
              },
              {
                "name": "type"
              },
              {
                "name": "note"
              }
            ]
          },
          "data": [
            {
              "0": "aa",
              "1": "bb",
              "2": "cc"
            }
          ]
        }
      }

This is how it is rendered:
image

Here is an example of the notebook. You can use this to reproduce the issue:

{
  "metadata": {
    "kernelspec": {
      "name": "SQL",
      "display_name": "SQL",
      "language": "sql"
    },
    "language_info": {
      "name": "sql",
      "version": ""
    }
  },
  "nbformat_minor": 2,
  "nbformat": 4,
  "cells": [
    {
      "cell_type": "code",
      "source": [
        "test"
      ],
      "metadata": {
        "azdata_cell_guid": "286d911b-c759-489c-b7f8-5490479dbddd",
        "language": "sql",
        "tags": []
      },
      "outputs": [
        {
          "output_type": "execute_result",
          "metadata": {},
          "execution_count": 4,
          "data": {
            "application/vnd.dataresource+json": {
              "schema": {
                "fields": [
                  {
                    "name": "name"
                  },
                  {
                    "name": "type"
                  },
                  {
                    "name": "note"
                  }
                ]
              },
              "data": [
                {
                  "0": "aa",
                  "1": "bb",
                  "2": "cc"
                }
              ]
            }
          }
        }
      ],
      "execution_count": 4
    }
  ]
}

Note that if the data object uses the filed names, it will work correctly.

		"data": [
		  {
			"name": "aa",
			"type": "bb",
			"note": "cc"
		  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions