Skip to content

Compatibility fixes for simplejson v4 - #928

Merged
thehrh merged 1 commit into
masterfrom
fix/simplejson_v4_compat
Apr 24, 2026
Merged

thehrh merged 1 commit into
masterfrom
fix/simplejson_v4_compat

Conversation

@thehrh

@thehrh thehrh commented Apr 19, 2026 •

Copy link
Copy Markdown
Collaborator

Resolves #927.

Locally passed all tests with simplejson v3.18.0 (neither allow_nan nor array_hook), v3.20.2 (no array_hook), and v4.0.1 (both allow_nan and array_hook). Python version used throughout: 3.14.4.

Details:

  • Instead of having differing definitions of NumpyDecoder depending on the detected version of simplejson, now just initialise the base class with different sets of arguments
  • no array_hook initialisation argument of NumpyDecoder (doesn't make sense IMO)
  • json_array_numpy() now has a new array_hook=None parameter and ignores any possible attempt of setting it by emitting a warning
  • comments and docstring should motivate the choices made here and benefit future maintainability

@thehrh thehrh added this to the 4.3 milestone Apr 19, 2026
@thehrh
thehrh merged commit 36ae09b into master Apr 24, 2026
2 checks passed
@thehrh
thehrh deleted the fix/simplejson_v4_compat branch April 24, 2026 09:09
@thehrh thehrh added dependencies Pull requests that update a dependency file and removed bug labels Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file external dependency

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pisa.utils.jsons.from_json() fails with new simplejson major release

2 participants