overture-stack / stage

GNU Affero General Public License v3.0
0 stars 4 forks source link

Multi-Stage Download #213

Open MitchellShiell opened 2 weeks ago

MitchellShiell commented 2 weeks ago

Summary

Selecting records from the RepoTable creates a 0B download file

Description

I have download functionality for a multi-arranger stage working however when I add any selections in the RepoTable the download comes out as 0B. Facets filtering and downloading works as expected.

All changes can be viewed from the following commit: https://github.com/overture-stack/stage/commit/bf03b47af752ca3cbf98bf4bcb08ea5ba9ba3b41

Suspected Solution

I suspect some mismanaged state/context regarding the arranger-components, TableContextProvider/Table?

Also could use some insight on which of these are important vs being virusSeq Specific: https://github.com/virusseq/portal-ui/commit/b20e261ef2c7c6e44af6ada1ab25b26c40e32e98#diff-f81b59533eae79f2da6a075813e4bec1756fa44b21e7ac66a76dc756c6b1d961R32-R36

Reproducing the issue

See the readme here: https://github.com/oicr-softeng/drug_discovery-ui/

MitchellShiell commented 2 weeks ago

Update

Added the following to my table.json located at /configurationFiles/arrangerConfigs/

{
    "table": {
        "rowIdFieldName": "id",
        "columns": [
        {

Note, _id does not work

Payload

However the issue persists

The payload on download is as follows notice that id is null:

{
    "fileName": "",
    "files": [
        {
            "documentType": "file",
            "fileName": "correlation-data-export.20241114.tsv",
            "fileType": "tsv",
            "maxRows": 0,
            "sqon": {
                "op": "and",
                "content": [
                    {
                        "op": "in",
                        "content": {
                            "fieldName": "file_autocomplete",
                            "value": [
                                "100___",
                                "108___",
                                "10___",
                                "12___",
                                "15___"
                            ]
                        }
                    }
                ]
            },
            "columns": [
                {
                    "accessor": "Projectcode",
                    "canChangeShow": true,
                    "displayFormat": null,
                    "displayName": "Project Code",
                    "displayType": "keyword",
                    "displayValues": {},
                    "fieldName": "Projectcode",
                    "id": null,
                    "isArray": false,
                    "jsonPath": "$.Projectcode",
                    "query": "Projectcode",
                    "show": true,
                    "sortable": true,
                    "type": null
                },
                {
                    "accessor": "A",
                    "canChangeShow": true,
                    "displayFormat": null,
                    "displayName": "Gene A",
                    "displayType": "keyword",
                    "displayValues": {},
                    "fieldName": "A",
                    "id": null,
                    "isArray": false,
                    "jsonPath": "$.A",
                    "query": "A",
                    "show": true,
                    "sortable": true,
                    "type": null
                },
                {
                    "accessor": "B",
                    "canChangeShow": true,
                    "displayFormat": null,
                    "displayName": "Gene B",
                    "displayType": "keyword",
                    "displayValues": {},
                    "fieldName": "B",
                    "id": null,
                    "isArray": false,
                    "jsonPath": "$.B",
                    "query": "B",
                    "show": true,
                    "sortable": true,
                    "type": null
                },
                {
                    "accessor": "Spearmancorr",
                    "canChangeShow": true,
                    "displayFormat": null,
                    "displayName": "Spearman Correlation",
                    "displayType": "scaled_float",
                    "displayValues": {},
                    "fieldName": "Spearmancorr",
                    "id": null,
                    "isArray": false,
                    "jsonPath": "$.Spearmancorr",
                    "query": "Spearmancorr",
                    "show": true,
                    "sortable": true,
                    "type": null
                },
                {
                    "accessor": "Spearmanp",
                    "canChangeShow": true,
                    "displayFormat": null,
                    "displayName": "Spearman P Value",
                    "displayType": "scaled_float",
                    "displayValues": {},
                    "fieldName": "Spearmanp",
                    "id": null,
                    "isArray": false,
                    "jsonPath": "$.Spearmanp",
                    "query": "Spearmanp",
                    "show": true,
                    "sortable": true,
                    "type": null
                },
                {
                    "accessor": "Pearsoncorr",
                    "canChangeShow": true,
                    "displayFormat": null,
                    "displayName": "Pearson Correlation",
                    "displayType": "scaled_float",
                    "displayValues": {},
                    "fieldName": "Pearsoncorr",
                    "id": null,
                    "isArray": false,
                    "jsonPath": "$.Pearsoncorr",
                    "query": "Pearsoncorr",
                    "show": true,
                    "sortable": true,
                    "type": null
                },
                {
                    "accessor": "Pearsonp",
                    "canChangeShow": true,
                    "displayFormat": null,
                    "displayName": "Pearson P Value",
                    "displayType": "scaled_float",
                    "displayValues": {},
                    "fieldName": "Pearsonp",
                    "id": null,
                    "isArray": false,
                    "jsonPath": "$.Pearsonp",
                    "query": "Pearsonp",
                    "show": true,
                    "sortable": true,
                    "type": null
                },
                {
                    "accessor": "Spearmancorrsquare",
                    "canChangeShow": true,
                    "displayFormat": null,
                    "displayName": "Spearman Correlation Square",
                    "displayType": "scaled_float",
                    "displayValues": {},
                    "fieldName": "Spearmancorrsquare",
                    "id": null,
                    "isArray": false,
                    "jsonPath": "$.Spearmancorrsquare",
                    "query": "Spearmancorrsquare",
                    "show": true,
                    "sortable": true,
                    "type": null
                },
                {
                    "accessor": "Pearsoncorrsquare",
                    "canChangeShow": true,
                    "displayFormat": null,
                    "displayName": "Pearson Correlation Square",
                    "displayType": "scaled_float",
                    "displayValues": {},
                    "fieldName": "Pearsoncorrsquare",
                    "id": null,
                    "isArray": false,
                    "jsonPath": "$.Pearsoncorrsquare",
                    "query": "Pearsoncorrsquare",
                    "show": true,
                    "sortable": true,
                    "type": null
                }
            ]
        }
    ]
}

GraphQL

Confirmation that Id exists in graphQL:

Query

query File {
  file {
    hits {
      edges {
        node {
          id
        }
      }
    }
  }
}

Response

[
  {
    "node.id": "100___"
  },
  {
    "node.id": "108___"
  },
  {
    "node.id": "10___"
  },
  {
    "node.id": "112___"
  },
  {
    "node.id": "114___"
  },
  {
    "node.id": "115___"
  },
  {
    "node.id": "121___"
  },
  {
    "node.id": "123___"
  },
  {
    "node.id": "124___"
  },
  {
    "node.id": "126___"
  }
]
MitchellShiell commented 2 weeks ago

Update

Need UUID, apply it under file autocomplete in index mapping, add customRowsExporter to stage, update table.json configs with default rowIdFieldName