From d16e3a449069978d38a98672e971da703bdd7be0 Mon Sep 17 00:00:00 2001 From: Michael Schuster Date: Thu, 28 Nov 2024 16:27:41 +0100 Subject: [PATCH] Quickstart fixes (#3227) * Replace zenml connect in quickstart * Linting --- examples/quickstart/quickstart.ipynb | 10 +--------- src/zenml/materializers/built_in_materializer.py | 8 +++----- src/zenml/types.py | 1 + src/zenml/utils/visualization_utils.py | 2 +- 4 files changed, 6 insertions(+), 15 deletions(-) diff --git a/examples/quickstart/quickstart.ipynb b/examples/quickstart/quickstart.ipynb index 067c262afb4..6b88699458e 100644 --- a/examples/quickstart/quickstart.ipynb +++ b/examples/quickstart/quickstart.ipynb @@ -149,7 +149,7 @@ "\n", "assert zenml_server_url\n", "\n", - "!zenml connect --url $zenml_server_url" + "!zenml login $zenml_server_url" ] }, { @@ -722,14 +722,6 @@ "* If you have questions or feedback... join our [**Slack Community**](https://zenml.io/slack) and become part of the ZenML family!\n", "* If you want to quickly get started with ZenML, check out [ZenML Pro](https://zenml.io/pro)." ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "c560354d-9e78-4061-aaff-2e6213229911", - "metadata": {}, - "outputs": [], - "source": [] } ], "metadata": { diff --git a/src/zenml/materializers/built_in_materializer.py b/src/zenml/materializers/built_in_materializer.py index a65d8ececeb..59d007b440a 100644 --- a/src/zenml/materializers/built_in_materializer.py +++ b/src/zenml/materializers/built_in_materializer.py @@ -414,11 +414,9 @@ def save(self, data: Any) -> None: for entry in metadata: self.artifact_store.rmtree(entry["path"]) raise e - + # save dict type objects to JSON file with JSON visualization type - def save_visualizations( - self, data: Any - ) -> Dict[str, "VisualizationType"]: + def save_visualizations(self, data: Any) -> Dict[str, "VisualizationType"]: """Save visualizations for the given data. Args: @@ -428,7 +426,7 @@ def save_visualizations( A dictionary of visualization URIs and their types. """ # dict/list type objects are always saved as JSON files - # doesn't work for non-serializable types as they + # 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} diff --git a/src/zenml/types.py b/src/zenml/types.py index 1f4e339e751..5c5e21313fa 100644 --- a/src/zenml/types.py +++ b/src/zenml/types.py @@ -34,5 +34,6 @@ class MarkdownString(str): class CSVString(str): """Special string class to indicate a CSV string.""" + class JSONString(str): """Special string class to indicate a JSON string.""" diff --git a/src/zenml/utils/visualization_utils.py b/src/zenml/utils/visualization_utils.py index 2011e70a88d..10c523fb165 100644 --- a/src/zenml/utils/visualization_utils.py +++ b/src/zenml/utils/visualization_utils.py @@ -16,7 +16,7 @@ import json from typing import TYPE_CHECKING, Optional -from IPython.core.display import HTML, Image, JSON, Markdown, display +from IPython.core.display import HTML, JSON, Image, Markdown, display from zenml.artifacts.utils import load_artifact_visualization from zenml.enums import VisualizationType