Skip to content
Snippets Groups Projects
Commit acef88a1 authored by stevereis's avatar stevereis
Browse files

Fix : return array on empty value

parent 975954e5
No related branches found
No related tags found
No related merge requests found
...@@ -32,6 +32,8 @@ export const transformToExperiment = jsonata(` ...@@ -32,6 +32,8 @@ export const transformToExperiment = jsonata(`
( (
$params := ["y", "pathology", "dataset", "filter"]; $params := ["y", "pathology", "dataset", "filter"];
$toArray := function($x) { $type($x) = 'array' ? $x : [$x]};
{ {
"name": name, "name": name,
"uuid": uuid, "uuid": uuid,
...@@ -48,12 +50,13 @@ export const transformToExperiment = jsonata(` ...@@ -48,12 +50,13 @@ export const transformToExperiment = jsonata(`
"datasets": $split(algorithm.parameters[name = "dataset"].value, ','), "datasets": $split(algorithm.parameters[name = "dataset"].value, ','),
"algorithm": { "algorithm": {
"name": algorithm.name, "name": algorithm.name,
"parameters" : "parameters" : $toArray(
algorithm.parameters[$not(name in $params)].({ algorithm.parameters[$not(name in $params)].({
"name": name, "name": name,
"label": label, "label": label,
"value": $split(value, ',') "value": $split(value, ',')
}) })
)
} }
} }
) )
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment