Skip to content

Commit d1ff2da

Browse files
committed
don't use f-strings
1 parent 01894b8 commit d1ff2da

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

metaflow/click_api.py

+8-9
Original file line numberDiff line numberDiff line change
@@ -65,17 +65,16 @@ def _method_sanity_check(
6565
for supplied_k, supplied_v in kwargs.items():
6666
if supplied_k not in possible_params:
6767
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()))
7070
)
7171

7272
try:
7373
check_type(supplied_v, annotations[supplied_k])
7474
except TypeCheckError:
7575
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])
7978
)
8079

8180
if supplied_k in possible_arg_params:
@@ -105,7 +104,7 @@ def _method_sanity_check(
105104
(cli_name not in method_params["args"])
106105
and (cli_name not in method_params["options"])
107106
) and possible_v.required:
108-
raise ValueError(f"Missing argument: {cli_name} is required.")
107+
raise ValueError("Missing argument: %s is required." % cli_name)
109108

110109
return method_params
111110

@@ -189,7 +188,7 @@ def from_cli(cls, flow_file: str, cli_collection: Callable) -> Callable:
189188
class_dict[cmd_obj.name] = extract_command(cmd_obj, flow_parameters)
190189
else:
191190
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))
193192
)
194193

195194
to_return = type(flow_file, (MetaflowAPI,), class_dict)
@@ -252,10 +251,10 @@ def execute(self) -> List[str]:
252251
for k, v in options.items():
253252
if isinstance(v, list):
254253
for i in v:
255-
components.append(f"--{k}")
254+
components.append("--%s" % k)
256255
components.append(str(i))
257256
else:
258-
components.append(f"--{k}")
257+
components.append("--%s" % k)
259258
if v != "flag":
260259
components.append(str(v))
261260

0 commit comments

Comments
 (0)