You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hamilton.apache.org by eb...@apache.org on 2026/09/20 19:37:00 UTC
(hamilton) branch main updated: fix: stop passing removed engine kwarg to plotly write_image (#1687)
This is an automated email from the ASF dual-hosted git repository.
elijahbenizzy pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/hamilton.git
The following commit(s) were added to refs/heads/main by this push:
new 76758bc8 fix: stop passing removed engine kwarg to plotly write_image (#1687)
76758bc8 is described below
commit 76758bc89eddf24b1de38a108f8c7450330d63b8
Author: jf <50...@users.noreply.github.com>
AuthorDate: Sun Sep 20 20:36:55 2026 +0100
fix: stop passing removed engine kwarg to plotly write_image (#1687)
---
.github/workflows/hamilton-main.yml | 1 -
hamilton/plugins/plotly_extensions.py | 2 +-
pyproject.toml | 4 ++--
tests/conftest.py | 2 --
tests/plugins/test_plotly_extensions.py | 8 ++++++++
5 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/.github/workflows/hamilton-main.yml b/.github/workflows/hamilton-main.yml
index 987e94a2..aecae09b 100644
--- a/.github/workflows/hamilton-main.yml
+++ b/.github/workflows/hamilton-main.yml
@@ -85,7 +85,6 @@ jobs:
- name: Test hamilton main package
run: |
uv sync --group test
- uv pip install "kaleido<0.4.0"
uv run pytest tests/ --cov=hamilton --ignore tests/integrations
diff --git a/hamilton/plugins/plotly_extensions.py b/hamilton/plugins/plotly_extensions.py
index 5ff74747..c1090e94 100644
--- a/hamilton/plugins/plotly_extensions.py
+++ b/hamilton/plugins/plotly_extensions.py
@@ -42,7 +42,7 @@ class PlotlyStaticWriter(DataSaver):
height: int | None = None
scale: int | float | None = None
validate: bool = True
- engine: str = "auto"
+ engine: str | None = None
def _get_saving_kwargs(self) -> dict:
kwargs = {}
diff --git a/pyproject.toml b/pyproject.toml
index df3c465f..9ad9d332 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -112,7 +112,7 @@ test = [
"dlt",
"fsspec",
"graphviz",
- "kaleido; python_version < '3.14'",
+ "kaleido",
"kedro; python_version < '3.14'",
"lancedb; python_version < '3.14'",
"lightgbm; python_version < '3.14'",
@@ -123,7 +123,7 @@ test = [
"networkx",
"openpyxl", # for excel data loader
"pandera[dask]",
- "plotly; python_version < '3.14'",
+ "plotly",
"polars; python_version < '3.14'",
"pyarrow",
"pydantic >=2.0",
diff --git a/tests/conftest.py b/tests/conftest.py
index 8842bb39..1d52afb5 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -26,8 +26,6 @@ if sys.version_info >= (3, 14):
"plugins/test_polars_extensions.py",
"plugins/test_polars_lazyframe_extensions.py",
"resources/narwhals_example.py",
- # plotly - no Python 3.14 support yet
- "plugins/test_plotly_extensions.py",
# xgboost - no Python 3.14 support yet
"plugins/test_xgboost_extensions.py",
# lightgbm - no Python 3.14 support yet
diff --git a/tests/plugins/test_plotly_extensions.py b/tests/plugins/test_plotly_extensions.py
index a2a0e48b..ce064eca 100644
--- a/tests/plugins/test_plotly_extensions.py
+++ b/tests/plugins/test_plotly_extensions.py
@@ -38,12 +38,20 @@ def test_plotly_static_writer(figure: go.Figure, tmp_path: pathlib.Path) -> None
file_path = tmp_path / "figure.png"
writer = PlotlyStaticWriter(path=file_path)
+ assert "engine" not in writer._get_saving_kwargs()
+
metadata = writer.save_data(figure)
assert file_path.exists()
assert metadata[FILE_METADATA]["path"] == str(file_path)
+def test_plotly_static_writer_preserves_explicit_engine(tmp_path: pathlib.Path) -> None:
+ writer = PlotlyStaticWriter(path=tmp_path / "figure.png", engine="kaleido")
+
+ assert writer._get_saving_kwargs()["engine"] == "kaleido"
+
+
def test_plotly_interactive_writer(figure: go.Figure, tmp_path: pathlib.Path) -> None:
file_path = tmp_path / "figure.html"