Skip to content

Migrate from ujson to orjson - #2185

Open
jjardon wants to merge 1 commit into
apache:masterfrom
jjardon:jjardon/orjson
Open

Migrate from ujson to orjson#2185
jjardon wants to merge 1 commit into
apache:masterfrom
jjardon:jjardon/orjson

Conversation

@jjardon

@jjardon jjardon commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

ujson is in maintenance-only mode and its own maintainers recommend migrating to orjson. This change replaces the dependency and updates the single call site in _cachekey.py.

Key differences handled:

  • orjson.dumps() returns bytes (so the extra .encode("utf-8") is removed)
  • sort_keys=True becomes option=orjson.OPT_SORT_KEYS
  • escape_forward_slashes=False is the default behaviour of orjson

Tested successfully at https://github.com/jjardon/buildstream-1/actions/runs/32796227859?pr=4

Fixes #2184

ujson is in maintenance-only mode and its own maintainers recommend
migrating to orjson. This change replaces the dependency and updates
the single call site in _cachekey.py.

Key differences handled:
- orjson.dumps() returns bytes (so the extra .encode("utf-8") is removed)
- sort_keys=True becomes option=orjson.OPT_SORT_KEYS
- escape_forward_slashes=False is the default behaviour of orjson
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.

Find replacement for ujson (ujson is in maintenance-only mode)

1 participant