From c2e4f5147934d80a15f4c24f32f1a7a3feb8f8b0 Mon Sep 17 00:00:00 2001 From: Peter Rowlands Date: Mon, 16 Jan 2023 15:36:09 +0900 Subject: [PATCH] serialize: fix mypy error --- dvc/utils/serialize/_common.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dvc/utils/serialize/_common.py b/dvc/utils/serialize/_common.py index ccfa8e028..0088e3cfa 100644 --- a/dvc/utils/serialize/_common.py +++ b/dvc/utils/serialize/_common.py @@ -101,7 +101,9 @@ def _modify_data( dumper: DumpersFn, fs: Optional["FileSystem"] = None, ): - exists_fn = fs.exists if fs else os.path.exists + exists_fn = cast( + Callable[["StrPath"], bool], fs.exists if fs else os.path.exists + ) file_exists = exists_fn(cast(str, path)) data = _load_data(path, parser=parser, fs=fs) if file_exists else {} yield data