@@ -978,6 +978,45 @@ def wf_mixed_positional_and_keyword_args() -> int:
978978 assert wf_pure_positional_args_spec .template .interface .outputs ["o0" ].type == output_type
979979
980980
981+ assert wf_mixed_positional_and_keyword_args_spec .template .nodes [0 ].inputs [0 ].binding .value == arg1_binding
982+ assert wf_mixed_positional_and_keyword_args_spec .template .nodes [0 ].inputs [1 ].binding .value == arg2_binding
983+ assert wf_mixed_positional_and_keyword_args_spec .template .interface .outputs ["o0" ].type == output_type
984+
985+ assert wf_pure_positional_args () == ret
986+ assert wf_mixed_positional_and_keyword_args () == ret
987+
988+ def test_positional_args_workflow_with_default_value ():
989+ arg1 = 5
990+ arg2 = 6
991+ ret = 17
992+
993+ @task
994+ def t1 (x : int , y : int ) -> int :
995+ return x + y * 2
996+
997+ @workflow
998+ def sub_wf (x : int = 1 , y : int = 2 ) -> int :
999+ return t1 (x = x , y = y )
1000+
1001+ @workflow
1002+ def wf_pure_positional_args () -> int :
1003+ return sub_wf (arg1 , arg2 )
1004+
1005+ @workflow
1006+ def wf_mixed_positional_and_keyword_args () -> int :
1007+ return sub_wf (arg1 , y = arg2 )
1008+
1009+ wf_pure_positional_args_spec = get_serializable (OrderedDict (), serialization_settings , wf_pure_positional_args )
1010+ wf_mixed_positional_and_keyword_args_spec = get_serializable (OrderedDict (), serialization_settings , wf_mixed_positional_and_keyword_args )
1011+
1012+ arg1_binding = Scalar (primitive = Primitive (integer = arg1 ))
1013+ arg2_binding = Scalar (primitive = Primitive (integer = arg2 ))
1014+ output_type = LiteralType (simple = SimpleType .INTEGER )
1015+
1016+ assert wf_pure_positional_args_spec .template .nodes [0 ].inputs [0 ].binding .value == arg1_binding
1017+ assert wf_pure_positional_args_spec .template .nodes [0 ].inputs [1 ].binding .value == arg2_binding
1018+ assert wf_pure_positional_args_spec .template .interface .outputs ["o0" ].type == output_type
1019+
9811020 assert wf_mixed_positional_and_keyword_args_spec .template .nodes [0 ].inputs [0 ].binding .value == arg1_binding
9821021 assert wf_mixed_positional_and_keyword_args_spec .template .nodes [0 ].inputs [1 ].binding .value == arg2_binding
9831022 assert wf_mixed_positional_and_keyword_args_spec .template .interface .outputs ["o0" ].type == output_type
0 commit comments