From eb33dfa87587237a4e0fa89f19df33eb095200f3 Mon Sep 17 00:00:00 2001 From: Jitendra Gundaniya Date: Wed, 23 Oct 2024 13:53:26 +0100 Subject: [PATCH] Fix import issue Signed-off-by: Jitendra Gundaniya --- package/kedro_viz/autoreload_file_filter.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package/kedro_viz/autoreload_file_filter.py b/package/kedro_viz/autoreload_file_filter.py index fa31cdf6d..0dc31d0f0 100644 --- a/package/kedro_viz/autoreload_file_filter.py +++ b/package/kedro_viz/autoreload_file_filter.py @@ -8,6 +8,7 @@ from typing import Optional, Set import pathspec +from pathspec import PathSpec from watchfiles import Change, DefaultFilter logger = logging.getLogger(__name__) @@ -39,7 +40,7 @@ def __init__(self, base_path: Optional[Path] = None): try: with open(gitignore_path, "r", encoding="utf-8") as gitignore_file: ignore_patterns = gitignore_file.read().splitlines() - self.gitignore_spec = pathspec.PathSpec.from_lines( + self.gitignore_spec: Optional[PathSpec] = pathspec.PathSpec.from_lines( "gitwildmatch", ignore_patterns ) except FileNotFoundError: