@@ -988,14 +988,17 @@ def wf_mixed_positional_and_keyword_args() -> int:
988988def test_positional_args_workflow_with_default_value ():
989989 arg1 = 5
990990 arg2 = 6
991+ default_arg1 = 1
992+ default_arg2 = 2
991993 ret = 17
994+ ret_arg2_default = 9
992995
993996 @task
994997 def t1 (x : int , y : int ) -> int :
995998 return x + y * 2
996999
9971000 @workflow
998- def sub_wf (x : int = 1 , y : int = 2 ) -> int :
1001+ def sub_wf (x : int = default_arg1 , y : int = default_arg2 ) -> int :
9991002 return t1 (x = x , y = y )
10001003
10011004 @workflow
@@ -1006,11 +1009,17 @@ def wf_pure_positional_args() -> int:
10061009 def wf_mixed_positional_and_keyword_args () -> int :
10071010 return sub_wf (arg1 , y = arg2 )
10081011
1012+ @workflow
1013+ def wf_mixed_positional_and_default_value () -> int :
1014+ return sub_wf (arg1 )
1015+
10091016 wf_pure_positional_args_spec = get_serializable (OrderedDict (), serialization_settings , wf_pure_positional_args )
10101017 wf_mixed_positional_and_keyword_args_spec = get_serializable (OrderedDict (), serialization_settings , wf_mixed_positional_and_keyword_args )
1018+ wf_mixed_positional_and_default_value_spec = get_serializable (OrderedDict (), serialization_settings , wf_mixed_positional_and_default_value )
10111019
10121020 arg1_binding = Scalar (primitive = Primitive (integer = arg1 ))
10131021 arg2_binding = Scalar (primitive = Primitive (integer = arg2 ))
1022+ default_arg2_binding = Scalar (primitive = Primitive (integer = default_arg2 ))
10141023 output_type = LiteralType (simple = SimpleType .INTEGER )
10151024
10161025 assert wf_pure_positional_args_spec .template .nodes [0 ].inputs [0 ].binding .value == arg1_binding
@@ -1021,8 +1030,13 @@ def wf_mixed_positional_and_keyword_args() -> int:
10211030 assert wf_mixed_positional_and_keyword_args_spec .template .nodes [0 ].inputs [1 ].binding .value == arg2_binding
10221031 assert wf_mixed_positional_and_keyword_args_spec .template .interface .outputs ["o0" ].type == output_type
10231032
1033+ assert wf_mixed_positional_and_default_value_spec .template .nodes [0 ].inputs [0 ].binding .value == arg1_binding
1034+ assert wf_mixed_positional_and_default_value_spec .template .nodes [0 ].inputs [1 ].binding .value == default_arg2_binding
1035+ assert wf_mixed_positional_and_default_value_spec .template .interface .outputs ["o0" ].type == output_type
1036+
10241037 assert wf_pure_positional_args () == ret
10251038 assert wf_mixed_positional_and_keyword_args () == ret
1039+ assert wf_mixed_positional_and_default_value () == ret_arg2_default
10261040
10271041def test_positional_args_workflow ():
10281042 arg1 = 5
0 commit comments