From 87d82693652d5dbcd5546174caa33a4d5eef494a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Saugat=20Pachhai=20=28=E0=A4=B8=E0=A5=8C=E0=A4=97=E0=A4=BE?= =?UTF-8?q?=E0=A4=A4=29?= Date: Mon, 14 Nov 2022 10:14:09 +0545 Subject: [PATCH] typecheck: fix type error in _git_info --- dvc/repo/data.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/dvc/repo/data.py b/dvc/repo/data.py index c9f6390a8..6317a4966 100644 --- a/dvc/repo/data.py +++ b/dvc/repo/data.py @@ -12,6 +12,7 @@ from typing import ( Optional, Tuple, TypedDict, + Union, cast, ) @@ -19,10 +20,9 @@ from dvc.fs.git import GitFileSystem from dvc.ui import ui if TYPE_CHECKING: - from scmrepo.base import Base - from dvc.output import Output from dvc.repo import Repo + from dvc.scm import Git, NoSCM from dvc_data.hashfile.db import HashFileDB from dvc_data.hashfile.hash_info import HashInfo from dvc_data.hashfile.obj import HashFile @@ -140,7 +140,9 @@ class GitInfo(TypedDict, total=False): is_dirty: bool -def _git_info(scm: "Base", untracked_files: str = "all") -> GitInfo: +def _git_info( + scm: Union["Git", "NoSCM"], untracked_files: str = "all" +) -> GitInfo: from scmrepo.exceptions import SCMError from dvc.scm import NoSCM