@@ -53,34 +53,36 @@ def load_workflow_json(file_name: str) -> WorkGraph:
5353 to_task = task_name_mapping [str (link [TARGET_LABEL ])]
5454 # if the input is not exit, it means we pass the data into to the kwargs
5555 # in this case, we add the input socket
56- try :
57- if link [TARGET_PORT_LABEL ] not in to_task .inputs :
58- to_socket = to_task .add_input ("workgraph.any" , name = link [TARGET_PORT_LABEL ])
59- else :
60- to_socket = to_task .inputs [link [TARGET_PORT_LABEL ]]
61- except :
62- breakpoint ()
56+ if link [TARGET_PORT_LABEL ] not in to_task .inputs :
57+ to_socket = to_task .add_input_spec ("workgraph.any" , name = link [TARGET_PORT_LABEL ])
58+ else :
59+ to_socket = to_task .inputs [link [TARGET_PORT_LABEL ]]
6360 from_task = task_name_mapping [str (link [SOURCE_LABEL ])]
6461 if isinstance (from_task , orm .Data ):
6562 to_socket .value = from_task
6663 else :
6764 try :
6865 if link [SOURCE_PORT_LABEL ] is None :
6966 link [SOURCE_PORT_LABEL ] = "result"
67+ # if link[SOURCE_PORT_LABEL] == 'result':
68+ # pass
69+ # link[SOURCE_PORT_LABEL] = "__result__"
7070 # because we are not define the outputs explicitly during the pythonjob creation
7171 # we add it here, and assume the output exit
72- if link [SOURCE_PORT_LABEL ] not in from_task .outputs :
73- # if str(link["sourcePort"]) not in from_task.outputs:
74- from_socket = from_task .add_output (
75- "workgraph.any" ,
76- name = link [SOURCE_PORT_LABEL ],
77- # name=str(link["sourcePort"]),
78- # metadata={"is_function_output": True},
79- )
80- else :
81- from_socket = from_task .outputs [link [SOURCE_PORT_LABEL ]]
72+ try :
73+ if link [SOURCE_PORT_LABEL ] not in from_task .outputs :
74+ # if str(link["sourcePort"]) not in from_task.outputs:
75+ from_socket = from_task .add_output_spec (
76+ "workgraph.any" ,
77+ name = link [SOURCE_PORT_LABEL ],
78+ )
79+ else :
80+ from_socket = from_task .outputs [link [SOURCE_PORT_LABEL ]]
8281
83- wg .add_link (from_socket , to_socket )
82+ wg .add_link (from_socket , to_socket )
83+ except :
84+ breakpoint ()
85+ pass
8486 except Exception as e :
8587 traceback .print_exc ()
8688 print ("Failed to link" , link , "with error:" , e )
0 commit comments