Skip to content

Commit 3fec971

Browse files
authored
Fix task data serialization (#38)
* Fix task data serialization * Fix path type for WorkFlow
1 parent caa4603 commit 3fec971

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

aiida_gui/app/task.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ async def read_task(id: int, path: str):
1414
from .utils import node_to_short_json
1515
from aiida.orm import load_node
1616
from aiida_workgraph.orm.workgraph import WorkGraphNode
17+
from aiida_workgraph.utils import deserialize_input_values_recursively
1718

1819
# import inspect
1920

@@ -22,7 +23,7 @@ async def read_task(id: int, path: str):
2223
segments = path.split("/")
2324
if isinstance(node, WorkGraphNode):
2425
ndata = node.workgraph_data["tasks"][segments[0]]
25-
ndata = deserialize_unsafe(ndata)
26+
deserialize_input_values_recursively(ndata["inputs"], deserialize_unsafe)
2627
executor = node.task_executors.get(segments[0], None)
2728
if len(segments) == 1:
2829
ndata["executor"] = executor if executor else {}
@@ -40,8 +41,9 @@ async def read_task(id: int, path: str):
4041
for child in map_info["children"]:
4142
for prefix in map_info["prefix"]:
4243
if f"{prefix}_{child}" == segments[1]:
43-
ndata = deserialize_unsafe(
44-
node.workgraph_data["tasks"][child]
44+
deserialize_input_values_recursively(
45+
node.workgraph_data["tasks"][child]["inputs"],
46+
deserialize_unsafe,
4547
)
4648
executor = node.task_executors.get(child)
4749
ndata["name"] = f"{prefix}_{child}"

frontend/src/components/WorkFlowItem.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export function useRete<T extends { destroy(): void }>(
7272

7373

7474

75-
function WorkflowItem({endPoint = 'workchain'}) {
75+
function WorkflowItem({pathType = 'workchain', endPoint = 'workchain'}) {
7676
const { pk } = useParams();
7777
const location = useLocation();
7878

@@ -86,7 +86,7 @@ function WorkflowItem({endPoint = 'workchain'}) {
8686
const [detailNodeViewSwitch, setDetailNodeViewSwitch] = useState(false); // State to manage the realtime switch
8787

8888
// This is the base path: /process/45082/
89-
const basePath = `/process/${pk}/`;
89+
const basePath = `/${pathType}/${pk}/`;
9090

9191
// subPath will be everything after that basePath in the URL.
9292
// e.g. if user visits /process/45082/sub_wg, subPath = "sub_wg"

0 commit comments

Comments
 (0)