diff --git a/package/kedro_viz/integrations/kedro/hooks.py b/package/kedro_viz/integrations/kedro/hooks.py index 4f49955a7d..1fb82c7b19 100644 --- a/package/kedro_viz/integrations/kedro/hooks.py +++ b/package/kedro_viz/integrations/kedro/hooks.py @@ -5,7 +5,7 @@ import json import logging from collections import defaultdict -from pathlib import Path +from pathlib import PurePosixPath from typing import Any, Union from kedro.framework.hooks import hook_impl @@ -135,7 +135,9 @@ def get_file_size(self, dataset: Any) -> Union[int, None]: return None try: - file_path = get_filepath_str(Path(dataset._filepath), dataset._protocol) + file_path = get_filepath_str( + PurePosixPath(dataset._filepath), dataset._protocol + ) return dataset._fs.size(file_path) except Exception as exc: