Skip to content

Handle Decimal in Kaleido JSON serialization#455

Open
Sean-Kenneth-Doherty wants to merge 1 commit into
plotly:masterfrom
Sean-Kenneth-Doherty:fix-decimal-orjson-default
Open

Handle Decimal in Kaleido JSON serialization#455
Sean-Kenneth-Doherty wants to merge 1 commit into
plotly:masterfrom
Sean-Kenneth-Doherty:fix-decimal-orjson-default

Conversation

@Sean-Kenneth-Doherty
Copy link
Copy Markdown

@Sean-Kenneth-Doherty Sean-Kenneth-Doherty commented May 17, 2026

Summary

Kaleido's orjson serializer now converts decimal.Decimal values to floats, matching Plotly's JSON encoder behavior. This keeps figures containing Decimal values serializable after the 1.3.0 switch to orjson.

Fixes #453

Validation

  • env TMPDIR=/home/sean/.cache uv run pytest tests/test_kaleido_tab.py tests/test_init.py tests/test_fig_tools.py tests/test_path_tools.py -q -W error: 280 passed
  • env TMPDIR=/home/sean/.cache uv run ruff check kaleido/_kaleido_tab/_tab.py tests/test_kaleido_tab.py: passed
  • env TMPDIR=/home/sean/.cache uv run ruff format --check kaleido/_kaleido_tab/_tab.py tests/test_kaleido_tab.py: 2 files already formatted
  • git diff --check origin/master...HEAD: passed

@Sean-Kenneth-Doherty Sean-Kenneth-Doherty marked this pull request as ready for review May 17, 2026 01:23
@Sean-Kenneth-Doherty
Copy link
Copy Markdown
Author

Local validation after refreshing the branch:

  • uv run pytest tests/test_kaleido_tab.py::test_orjson_default_handles_decimal -q -> 1 passed
  • uv run pytest tests/test_fig_tools.py tests/test_kaleido_tab.py -q -> 257 passed
  • git diff --check origin/master...HEAD -> clean

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Kaleido version 1.3.0 can't handle Decimals

1 participant