From c8f076e2aa27fb968634c0c598f4adab2371eb0b Mon Sep 17 00:00:00 2001 From: Deepyaman Datta Date: Mon, 23 Sep 2024 16:40:07 -0600 Subject: [PATCH] revert(datasets): use pathlib, ignore Windows test Refs: b7ff0c7 Signed-off-by: Deepyaman Datta --- kedro-datasets/kedro_datasets/ibis/file_dataset.py | 3 +-- kedro-datasets/tests/ibis/test_file_dataset.py | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/kedro-datasets/kedro_datasets/ibis/file_dataset.py b/kedro-datasets/kedro_datasets/ibis/file_dataset.py index 72b53d2b6..a55e92a68 100644 --- a/kedro-datasets/kedro_datasets/ibis/file_dataset.py +++ b/kedro-datasets/kedro_datasets/ibis/file_dataset.py @@ -1,7 +1,6 @@ """Provide file loading and saving functionality for Ibis's backends.""" from __future__ import annotations -import os from copy import deepcopy from pathlib import Path, PurePosixPath from typing import TYPE_CHECKING, Any, ClassVar @@ -119,7 +118,7 @@ def __init__( # noqa: PLR0913 super().__init__( filepath=PurePosixPath(filepath), version=version, - exists_function=os.path.exists, + exists_function=lambda filepath: Path(filepath).exists(), ) # Set load and save arguments, overwriting defaults if provided. diff --git a/kedro-datasets/tests/ibis/test_file_dataset.py b/kedro-datasets/tests/ibis/test_file_dataset.py index 7a41b2576..e598bffff 100644 --- a/kedro-datasets/tests/ibis/test_file_dataset.py +++ b/kedro-datasets/tests/ibis/test_file_dataset.py @@ -1,3 +1,4 @@ +import sys from pathlib import Path from time import sleep @@ -251,6 +252,7 @@ def test_save_version_warning( with pytest.warns(UserWarning, match=pattern): versioned_file_dataset.save(dummy_table) + @pytest.mark.skipif(sys.platform == "win32", reason="different error on windows") def test_versioning_existing_dataset( self, file_dataset, versioned_file_dataset, dummy_table ):