From a70ddc214c050031342c77be808d9bd2818b447c Mon Sep 17 00:00:00 2001 From: Baris Can Durak Date: Tue, 3 Dec 2024 17:40:55 +0100 Subject: [PATCH 1/4] fixing the windows bug --- tests/unit/test_general.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/unit/test_general.py b/tests/unit/test_general.py index 5176acb8acf..1a4c4207172 100644 --- a/tests/unit/test_general.py +++ b/tests/unit/test_general.py @@ -15,6 +15,7 @@ import os from tempfile import TemporaryDirectory from typing import Any, Callable, Optional, Type +from pathlib import Path from zenml.client import Client from zenml.constants import ENV_ZENML_DEBUG @@ -95,7 +96,7 @@ def _test_materializer( assert len(visualizations) > 0 for uri, value in visualizations.items(): assert isinstance(uri, str) - assert "\\" not in uri + assert "\\" not in Path(uri).as_posix() assert isinstance(value, VisualizationType) assert os.path.exists(uri) From a2133742330701c013db4fed7f8a62fbdab54046 Mon Sep 17 00:00:00 2001 From: Baris Can Durak Date: Tue, 3 Dec 2024 17:41:21 +0100 Subject: [PATCH 2/4] formatting --- tests/unit/test_general.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/test_general.py b/tests/unit/test_general.py index 1a4c4207172..5e900c28ffb 100644 --- a/tests/unit/test_general.py +++ b/tests/unit/test_general.py @@ -13,9 +13,9 @@ # permissions and limitations under the License. import os +from pathlib import Path from tempfile import TemporaryDirectory from typing import Any, Callable, Optional, Type -from pathlib import Path from zenml.client import Client from zenml.constants import ENV_ZENML_DEBUG From df24e953be7fa881ba9fba314ad560b49822a42b Mon Sep 17 00:00:00 2001 From: Baris Can Durak Date: Tue, 3 Dec 2024 17:45:38 +0100 Subject: [PATCH 3/4] remove the test --- tests/unit/test_general.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/unit/test_general.py b/tests/unit/test_general.py index 5e900c28ffb..085b6183737 100644 --- a/tests/unit/test_general.py +++ b/tests/unit/test_general.py @@ -13,7 +13,6 @@ # permissions and limitations under the License. import os -from pathlib import Path from tempfile import TemporaryDirectory from typing import Any, Callable, Optional, Type @@ -96,7 +95,6 @@ def _test_materializer( assert len(visualizations) > 0 for uri, value in visualizations.items(): assert isinstance(uri, str) - assert "\\" not in Path(uri).as_posix() assert isinstance(value, VisualizationType) assert os.path.exists(uri) From 70cbbb603fad37b8b5ab90b7df85bafaa525b033 Mon Sep 17 00:00:00 2001 From: Baris Can Durak Date: Tue, 3 Dec 2024 17:58:37 +0100 Subject: [PATCH 4/4] adding the test back in --- src/zenml/materializers/built_in_materializer.py | 2 +- tests/unit/test_general.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/zenml/materializers/built_in_materializer.py b/src/zenml/materializers/built_in_materializer.py index 59d007b440a..06e28291c73 100644 --- a/src/zenml/materializers/built_in_materializer.py +++ b/src/zenml/materializers/built_in_materializer.py @@ -429,7 +429,7 @@ def save_visualizations(self, data: Any) -> Dict[str, "VisualizationType"]: # doesn't work for non-serializable types as they # are saved as list of lists in different files if _is_serializable(data): - return {self.data_path: VisualizationType.JSON} + return {self.data_path.replace("\\", "/"): VisualizationType.JSON} return {} def extract_metadata(self, data: Any) -> Dict[str, "MetadataType"]: diff --git a/tests/unit/test_general.py b/tests/unit/test_general.py index 085b6183737..5176acb8acf 100644 --- a/tests/unit/test_general.py +++ b/tests/unit/test_general.py @@ -95,6 +95,7 @@ def _test_materializer( assert len(visualizations) > 0 for uri, value in visualizations.items(): assert isinstance(uri, str) + assert "\\" not in uri assert isinstance(value, VisualizationType) assert os.path.exists(uri)