Skip to content

Make orjson optional for JSON handling - #477

Closed
FranciscoMaxwell wants to merge 1 commit into
plotly:mainfrom
FranciscoMaxwell:remove-orjson-hard-dependency
Closed

FranciscoMaxwell wants to merge 1 commit into
plotly:mainfrom
FranciscoMaxwell:remove-orjson-hard-dependency

Conversation

@FranciscoMaxwell

Copy link
Copy Markdown

Closes #423.

Summary

  • routes Kaleido JSON serialization/deserialization through a small backend wrapper
  • keeps using orjson when it is installed, but falls back to the stdlib json module when it is unavailable
  • preserves handling for Decimal, datetime-like values, and list-like/numpy-style values
  • removes orjson from required project dependencies and updates fallback coverage

Validation

  • python -m compileall kaleido\_json.py kaleido\_kaleido_tab\_tab.py kaleido\mocker\_utils.py tests\test_orjson_encoder.py tests\test_kaleido_tab.py
  • direct fallback smoke test with orjson set to None
  • git diff --check

I could not run the full pytest/ruff/uv validation locally because this environment does not have pytest, ruff, uv, or Kaleido runtime dependencies such as choreographer installed.

@camdecoster

Copy link
Copy Markdown
Contributor

Thanks for the PR! This change is already covered in #454, which itself may be rendered moot by some upcoming changes when I upgrade choreographer in this repo. I'm closing this PR in favor of the existing one. Feel free to comment over there.

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.

Remove ORJSON hard dep for 3.14t's sake

2 participants