VizierDB / web-api-async

Vizier Asynchronous Web API
Apache License 2.0
2 stars 2 forks source link

Making sure that dataset properties show up in serialized DatasetHandles #99

Closed okennedy closed 4 years ago

okennedy commented 4 years ago

(re https://github.com/VizierDB/web-ui/issues/236 ) (re https://github.com/VizierDB/web-ui/issues/237 )

Also:

okennedy commented 4 years ago

Here's what the serialized dataset handle now looks like: @soniacq @maqzi Note in particular the "properties" field.

okennedy@saruman:~$ curl http://localhost:5000/vizier-db/api/v1/projects/28d103be/datasets/DATASOURCE_R_304508488
{
  "columns": [
    {
      "id": 0, 
      "name": "A", 
      "type": "short"
    }, 
    {
      "id": 1, 
      "name": "B", 
      "type": "short"
    }, 
    {
      "id": 2, 
      "name": "C", 
      "type": "short"
    }
  ], 
  "id": "DATASOURCE_R_304508488", 
  "links": [
    {
      "href": "http://localhost:5000/vizier-db/api/v1/projects/28d103be/datasets/DATASOURCE_R_304508488", 
      "rel": "self"
    }, 
    {
      "href": "http://localhost:5000/vizier-db/api/v1/projects/28d103be/datasets/DATASOURCE_R_304508488?limit=-1", 
      "rel": "dataset.fetch"
    }, 
    {
      "href": "http://localhost:5000/vizier-db/api/v1/projects/28d103be/datasets/DATASOURCE_R_304508488/csv", 
      "rel": "dataset.download"
    }, 
    {
      "href": "http://localhost:5000/vizier-db/api/v1/projects/28d103be/datasets/DATASOURCE_R_304508488/annotations", 
      "rel": "annotations.get"
    }, 
    {
      "href": "http://localhost:5000/vizier-db/api/v1/projects/28d103be/datasets/DATASOURCE_R_304508488?offset=0", 
      "rel": "page.first"
    }
  ], 
  "name": "DATASOURCE_R_304508488", 
  "offset": 0, 
  "properties": {
    "columns": [
      {
        "column": {
          "id": 0, 
          "name": "A", 
          "type": "short"
        }, 
        "count": 6, 
        "distinctValueCount": 3, 
        "max": 4, 
        "mean": 1.8333333730697632, 
        "min": 1, 
        "stdDev": 1.1690452098846436, 
        "sum": 11
      }, 
      {
        "column": {
          "id": 1, 
          "name": "B", 
          "type": "short"
        }, 
        "count": 5, 
        "distinctValueCount": 3, 
        "max": 4, 
        "mean": 2.5999999046325684, 
        "min": 2, 
        "stdDev": 0.8944271802902222, 
        "sum": 13
      }, 
      {
        "column": {
          "id": 2, 
          "name": "C", 
          "type": "short"
        }, 
        "count": 5, 
        "distinctValueCount": 3, 
        "max": 4, 
        "mean": 1.7999999523162842, 
        "min": 1, 
        "stdDev": 1.3038405179977417, 
        "sum": 9
      }
    ], 
    "count": 6
  }, 
  "rowCount": 6, 
  "rows": [
    {
      "id": "-60674725", 
      "rowAnnotationFlags": [
        true, 
        true, 
        true
      ], 
      "values": [
        1, 
        3, 
        1
      ]
    }, 
    {
      "id": "-149247984", 
      "rowAnnotationFlags": [
        true, 
        true, 
        true
      ], 
      "values": [
        2, 
        null, 
        1
      ]
    }, 
    {
      "id": "-1577375462", 
      "rowAnnotationFlags": [
        true, 
        true, 
        true
      ], 
      "values": [
        1, 
        2, 
        null
      ]
    }, 
    {
      "id": "-864631135", 
      "rowAnnotationFlags": [
        true, 
        true, 
        true
      ], 
      "values": [
        1, 
        4, 
        2
      ]
    }, 
    {
      "id": "1890097888", 
      "rowAnnotationFlags": [
        true, 
        true, 
        true
      ], 
      "values": [
        2, 
        2, 
        1
      ]
    }, 
    {
      "id": "-212098694", 
      "rowAnnotationFlags": [
        true, 
        true, 
        true
      ], 
      "values": [
        4, 
        2, 
        4
      ]
    }
  ]
}