GlobalPathogenAnalysisService / gpas-cli

The CLI client for GPAS SC2
Other
5 stars 2 forks source link

EC 1.1.4: Error message is wrong if sample names are empty #94

Closed KuzminaAnna closed 1 year ago

KuzminaAnna commented 1 year ago

Describe the problem/error: Error message is wrong if the sample names are empty, with 0.6.0 gpas-cli currently the following error message is returned to the user "SyntaxError: Unexpected token N in JSON at position 440" Expected behaviour: "sample_name cannot be empty" error message should be returned to the user

Steps to Reproduce:

System Identification: DEV Reproducible? Yes If multiple areas are impacted list areas: Electron client 1.1.4 all platforms. If compatibility/interoperability is impacted list products (e.g.): Gpas Portals.

illumina-fastq-upload_sample_name_empty.csv.zip Oxford board ticket link https://oc-collab.gc3.ocs.oraclecloud.com/browse/C900000008-1006 Screen Shot 2022-11-15 at 7 12 05 PM

bede commented 1 year ago

While the JSON output for this CSV under 0.6.0 has some issues which I fixed in 0.7.x, I am unable to reproduce this error under either gpas-cli 0.6.0 or tip of main.

0.6.0:

% gpas upload --environment dev --token tests/test-data/token.json /Users/bede/Downloads/illumina-fastq-upload_sample_name_empty.csv --json-messages 
{
    "validation": {
        "status": "failure",
        "errors": [
            {
                "error": "sample_name cannot be empty"
            },
            {
                "sample_name": 1.0,
                "error": "sample_name cannot be empty"
            },
            {
                "sample_name": 2.0,
                "error": "sample_name cannot be empty"
            },
            {
                "sample_name": NaN,
                "error": "district can only contain characters (\\\\sA-Za-z0-9:_-)"
            },
            {
                "sample_name": NaN,
                "error": "fastq1 file does not exist"
            },
            {
                "sample_name": NaN,
                "error": "fastq2 file does not exist"
            },
            {
                "sample_name": NaN
            }
        ]
    }
}
bede commented 1 year ago

Confident this has been fixed in 0.8.0 if not earlier