@@ -65,17 +65,16 @@ def _method_sanity_check(
65
65
for supplied_k , supplied_v in kwargs .items ():
66
66
if supplied_k not in possible_params :
67
67
raise ValueError (
68
- f "Unknown argument: '{ supplied_k } ', "
69
- f"possible args are: { list (possible_params .keys ())} "
68
+ "Unknown argument: '%s ', possible args are: %s "
69
+ % ( supplied_k , list (possible_params .keys ()))
70
70
)
71
71
72
72
try :
73
73
check_type (supplied_v , annotations [supplied_k ])
74
74
except TypeCheckError :
75
75
raise TypeError (
76
- f"Invalid type for '{ supplied_k } ', "
77
- f"expected: '{ annotations [supplied_k ]} ', "
78
- f"default is '{ defaults [supplied_k ]} '"
76
+ "Invalid type for '%s', expected: '%s', default is '%s'"
77
+ % (supplied_k , annotations [supplied_k ], defaults [supplied_k ])
79
78
)
80
79
81
80
if supplied_k in possible_arg_params :
@@ -105,7 +104,7 @@ def _method_sanity_check(
105
104
(cli_name not in method_params ["args" ])
106
105
and (cli_name not in method_params ["options" ])
107
106
) and possible_v .required :
108
- raise ValueError (f "Missing argument: { cli_name } is required." )
107
+ raise ValueError ("Missing argument: %s is required." % cli_name )
109
108
110
109
return method_params
111
110
@@ -189,7 +188,7 @@ def from_cli(cls, flow_file: str, cli_collection: Callable) -> Callable:
189
188
class_dict [cmd_obj .name ] = extract_command (cmd_obj , flow_parameters )
190
189
else :
191
190
raise RuntimeError (
192
- f "Cannot handle { cmd_obj . name } of type { type (cmd_obj )} "
191
+ "Cannot handle %s of type %s" % ( cmd_obj . name , type (cmd_obj ))
193
192
)
194
193
195
194
to_return = type (flow_file , (MetaflowAPI ,), class_dict )
@@ -252,10 +251,10 @@ def execute(self) -> List[str]:
252
251
for k , v in options .items ():
253
252
if isinstance (v , list ):
254
253
for i in v :
255
- components .append (f "--{ k } " )
254
+ components .append ("--%s" % k )
256
255
components .append (str (i ))
257
256
else :
258
- components .append (f "--{ k } " )
257
+ components .append ("--%s" % k )
259
258
if v != "flag" :
260
259
components .append (str (v ))
261
260
0 commit comments