From caab767156375114078cf8d85031863361326b5f Mon Sep 17 00:00:00 2001 From: Stainless Bot <107565488+stainless-bot@users.noreply.github.com> Date: Thu, 30 Nov 2023 12:52:50 -0500 Subject: [PATCH] chore(internal): replace string concatenation with f-strings (#909) --- src/openai/lib/_validators.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/openai/lib/_validators.py b/src/openai/lib/_validators.py index ae48aafa88..e36f0e95fb 100644 --- a/src/openai/lib/_validators.py +++ b/src/openai/lib/_validators.py @@ -309,7 +309,7 @@ def common_completion_prefix_validator(df: pd.DataFrame) -> Remediation: return Remediation(name="common_prefix") def remove_common_prefix(x: Any, prefix: Any, ws_prefix: Any) -> Any: - x["completion"] = x["completion"].str[len(prefix):] + x["completion"] = x["completion"].str[len(prefix) :] if ws_prefix: # keep the single whitespace as prefix x["completion"] = f" {x['completion']}" @@ -623,9 +623,7 @@ def get_outfnames(fname: str, split: bool) -> list[str]: i = 0 while True: index_suffix = f" ({i})" if i > 0 else "" - candidate_fnames = [ - f"{os.path.splitext(fname)[0]}_prepared{suffix}{index_suffix}.jsonl" for suffix in suffixes - ] + candidate_fnames = [f"{os.path.splitext(fname)[0]}_prepared{suffix}{index_suffix}.jsonl" for suffix in suffixes] if not any(os.path.isfile(f) for f in candidate_fnames): return candidate_fnames i += 1