Skip to content

ZD 595: Bump kaleido to newer version to avoid hanging#498

Merged
hunner merged 1 commit intomainfrom
hunner/sc-15863/update-kaleido-version
Apr 30, 2026
Merged

ZD 595: Bump kaleido to newer version to avoid hanging#498
hunner merged 1 commit intomainfrom
hunner/sc-15863/update-kaleido-version

Conversation

@hunner
Copy link
Copy Markdown
Contributor

@hunner hunner commented Apr 29, 2026

Pull Request Description

What and why?

A customer is experiencing hangs in figure.to_html() because it calls self.figure.to_image(format="png") which uses kaleido, The customer verified this with a separate python call to kaleido outside of the library, then upgraded kaleido to 1.2.0 (the latest) and tried again and their software no longer hung.

How to test

Have a notebook that uses run_test() with a plot generated by kaleido. It should still work fine.

eg

import importlib.metadata
import time
import plotly.graph_objects as go
from validmind.vm_models.figure import Figure

assert tuple(int(x) for x in importlib.metadata.version("kaleido").split(".")[:2]) >= (1, 2)

fig = go.Figure(data=go.Bar(x=["A", "B", "C"], y=[1, 3, 2]))
vm_fig = Figure(key="test", figure=fig, ref_id="ref1")

# Figure.to_html() is the path that hung in ZD-595 (called by run_test(show=True))
start = time.time()
html = vm_fig.to_html()
print(f"Figure.to_html(): {len(html):,} chars in {time.time()-start:.2f}s")

files = vm_fig.serialize_files()
print(f"serialize_files(): image={len(files['image'][1]):,}b  json={len(files['json_image'][1]):,}b")

What needs special review?

None

Dependencies, breaking changes, and deployment notes

None

Release notes

  • Update kaleido dependency to 1.2.0

Checklist

  • What and why
  • Screenshots or videos (Frontend)
  • How to test
  • What needs special review
  • Dependencies, breaking changes, and deployment notes
  • Labels applied
  • PR linked to Shortcut
  • Unit tests added (Backend)
  • Tested locally
  • Documentation updated (if required)
  • Environment variable additions/changes documented (if required)

@hunner hunner requested a review from juanmleng April 29, 2026 00:16
@hunner hunner added bug Something isn't working python Pull requests that update Python code support Support-related PR labels Apr 29, 2026
@hunner hunner force-pushed the hunner/sc-15863/update-kaleido-version branch from 43cd9ee to a8268c8 Compare April 29, 2026 15:32
@github-actions
Copy link
Copy Markdown
Contributor

PR Summary

This PR updates a number of dependency definitions in the project's poetry lock file and the pyproject.toml. The key changes include:

  • Adding new packages such as choreographer, logistro, pytest-timeout, and simplejson with their corresponding versions, file hashes, and Python compatibility details.
  • Upgrading the kaleido package from version 0.2.1 to 1.2.0 and updating its associated metadata (description, Python version requirements, and file distribution formats).
  • Modifying multiple packages (e.g., iniconfig, orjson, pluggy, pytest) to set optional to false and adjust or remove marker conditions, ensuring they are treated as main dependencies rather than optional ones.
  • Updating dependency markers to either broaden or tighten the supported Python version criteria, which can improve compatibility and deployment consistency.
  • Reflecting the change in the production dependency declaration in the pyproject.toml, where the kaleido version requirement is updated to the newer version range.

These modifications are primarily dependency management related and aim to ensure that the project uses updated packages along with their latest security fixes and features.

Test Suggestions

  • Run the full test suite (unit and integration tests) with the updated dependencies to ensure compatibility.
  • Verify that the new packages (e.g., choreographer, logistro, simplejson, pytest-timeout) are installed correctly and function as expected in a fresh environment.
  • Perform dependency vulnerability scans to ensure none of the new or updated packages introduce security risks.
  • Test on different Python versions (as specified by the markers) to confirm that the restrictions and compatibility changes are correctly enforced.

@hunner hunner requested a review from johnwalz97 April 30, 2026 15:15
Copy link
Copy Markdown
Contributor

@johnwalz97 johnwalz97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very nice! ty

@hunner hunner merged commit 899dd7e into main Apr 30, 2026
54 of 55 checks passed
@hunner hunner deleted the hunner/sc-15863/update-kaleido-version branch April 30, 2026 16:26
@hunner hunner mentioned this pull request Apr 30, 2026
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working python Pull requests that update Python code support Support-related PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants