diff --git a/kedro-datasets/RELEASE.md b/kedro-datasets/RELEASE.md index 1d7ce738b..15a227da3 100755 --- a/kedro-datasets/RELEASE.md +++ b/kedro-datasets/RELEASE.md @@ -8,8 +8,9 @@ | `opik.OpikEvaluationDataset` | A dataset for managing Opik evaluation datasets. | `kedro_datasets_experimental.opik` | ## Bug fixes and other changes +- Added `os.PathLike` support for `plotly` datasets. ## Community contributions - +- [Datascienceio](https://github.com/datascienceio) # Release 9.3.0 ## Major features and improvements diff --git a/kedro-datasets/kedro_datasets/plotly/html_dataset.py b/kedro-datasets/kedro_datasets/plotly/html_dataset.py index 92a9a1e7f..83bbc06ab 100644 --- a/kedro-datasets/kedro_datasets/plotly/html_dataset.py +++ b/kedro-datasets/kedro_datasets/plotly/html_dataset.py @@ -3,6 +3,7 @@ """ from __future__ import annotations +import os from copy import deepcopy from pathlib import PurePosixPath from typing import Any, NoReturn @@ -53,7 +54,7 @@ class HTMLDataset(AbstractVersionedDataset[go.Figure, go.Figure | go.FigureWidge def __init__( # noqa: PLR0913 self, *, - filepath: str, + filepath: str | os.PathLike, save_args: dict[str, Any] | None = None, version: Version | None = None, credentials: dict[str, Any] | None = None, diff --git a/kedro-datasets/kedro_datasets/plotly/json_dataset.py b/kedro-datasets/kedro_datasets/plotly/json_dataset.py index fc291ff67..3e3d1587d 100644 --- a/kedro-datasets/kedro_datasets/plotly/json_dataset.py +++ b/kedro-datasets/kedro_datasets/plotly/json_dataset.py @@ -4,6 +4,7 @@ from __future__ import annotations import json +import os from copy import deepcopy from pathlib import PurePosixPath from typing import Any @@ -59,7 +60,7 @@ class JSONDataset(AbstractVersionedDataset[go.Figure, go.Figure | go.FigureWidge def __init__( # noqa: PLR0913 self, *, - filepath: str, + filepath: str | os.PathLike, load_args: dict[str, Any] | None = None, save_args: dict[str, Any] | None = None, version: Version | None = None, diff --git a/kedro-datasets/kedro_datasets/plotly/plotly_dataset.py b/kedro-datasets/kedro_datasets/plotly/plotly_dataset.py index b2c87fe14..e50290035 100644 --- a/kedro-datasets/kedro_datasets/plotly/plotly_dataset.py +++ b/kedro-datasets/kedro_datasets/plotly/plotly_dataset.py @@ -5,6 +5,7 @@ from __future__ import annotations import json +import os from copy import deepcopy from typing import Any @@ -70,7 +71,7 @@ class PlotlyDataset(JSONDataset): def __init__( # noqa: PLR0913 self, *, - filepath: str, + filepath: str | os.PathLike, plotly_args: dict[str, Any], load_args: dict[str, Any] | None = None, save_args: dict[str, Any] | None = None, diff --git a/kedro-datasets/tests/plotly/test_html_dataset.py b/kedro-datasets/tests/plotly/test_html_dataset.py index a37bffcc9..af5e10e43 100644 --- a/kedro-datasets/tests/plotly/test_html_dataset.py +++ b/kedro-datasets/tests/plotly/test_html_dataset.py @@ -14,7 +14,7 @@ @pytest.fixture def filepath_html(tmp_path): - return (tmp_path / "test.html").as_posix() + return tmp_path / "test.html" @pytest.fixture diff --git a/kedro-datasets/tests/plotly/test_json_dataset.py b/kedro-datasets/tests/plotly/test_json_dataset.py index 5dbaf8f77..413d776fd 100644 --- a/kedro-datasets/tests/plotly/test_json_dataset.py +++ b/kedro-datasets/tests/plotly/test_json_dataset.py @@ -15,7 +15,7 @@ @pytest.fixture def filepath_json(tmp_path): - return (tmp_path / "test.json").as_posix() + return tmp_path / "test.json" @pytest.fixture diff --git a/kedro-datasets/tests/plotly/test_plotly_dataset.py b/kedro-datasets/tests/plotly/test_plotly_dataset.py index f72243099..aec40615d 100644 --- a/kedro-datasets/tests/plotly/test_plotly_dataset.py +++ b/kedro-datasets/tests/plotly/test_plotly_dataset.py @@ -17,7 +17,7 @@ @pytest.fixture def filepath_json(tmp_path): - return (tmp_path / "test.json").as_posix() + return tmp_path / "test.json" @pytest.fixture