Skip to content
Snippets Groups Projects
Commit a5200aa5 authored by Riccardo Boero's avatar Riccardo Boero :innocent:
Browse files

Fix workflow task parsing

parent fdcd1288
No related branches found
No related tags found
No related merge requests found
name = "FACT_workflow_manager"
uuid = "34b7aff1-f91f-4b8b-9a3d-d0a54f07d855"
authors = ["Riccardo Boero <ribo@nilu.no>"]
version = "0.0.8"
version = "0.0.9"
[deps]
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
......
......@@ -54,14 +54,21 @@ function parseWorkflow(filePath::String)
# Flatten tasks into a list of dictionaries
tasks = []
for (task_name, task_details) in data["tasks"]
# Skip non-dictionary entries (e.g., `id = "no_counties"`)
if task_details isa Dict
# Add the task name as the "id" and flatten into a single dictionary
task_details["id"] = task_name
push!(tasks, task_details)
else
error("Invalid task structure for task '$task_name': Expected a dictionary.")
println("Skipping non-dictionary task entry: '$task_name'. Value: ", task_details)
end
end
# Validate that at least one task is parsed
if isempty(tasks)
error("No valid tasks found in the workflow file.")
end
return tasks
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment