Skip to content

Add ability to override default serialization#2018

Merged
xrmx merged 2 commits intoelastic:mainfrom
xrmx:serialize-nan-as-null
Mar 29, 2024
Merged

Add ability to override default serialization#2018
xrmx merged 2 commits intoelastic:mainfrom
xrmx:serialize-nan-as-null

Conversation

@xrmx
Copy link
Member

@xrmx xrmx commented Mar 29, 2024

What does this pull request do?

This PR introduces a new JSON serialization using simplejson that does a stricter serialization encoding floats like nan, +inf and -inf to null.
Then it makes the json serialization configurable from outside.

Related issues

Refs #1886

Add an alternative json serialization and deserialization implementation
using simplejson configured to be JSON compliant by converting floats like
nan, +inf and -inf to null .
The idea is to permit users to use a different serialization if they
need a different behaviour.

Refs elastic#1886
@xrmx xrmx force-pushed the serialize-nan-as-null branch from b0a4d51 to 1cc69a4 Compare March 29, 2024 10:12
@xrmx xrmx requested a review from basepi March 29, 2024 10:29
We get a string from config so need to import it.
@xrmx xrmx force-pushed the serialize-nan-as-null branch from 1cc69a4 to 2c3bd1a Compare March 29, 2024 10:39
@xrmx xrmx merged commit 3688340 into elastic:main Mar 29, 2024
xrmx added a commit to xrmx/apm-agent-python that referenced this pull request Apr 3, 2024
* utils: add simplejson based JSON handling

Add an alternative json serialization and deserialization implementation
using simplejson configured to be JSON compliant by converting floats like
nan, +inf and -inf to null .
The idea is to permit users to use a different serialization if they
need a different behaviour.

Refs elastic#1886

* client: fix overriding of transport json serializer

We get a string from config so need to import it.
xrmx added a commit that referenced this pull request Apr 4, 2024
* utils: add simplejson based JSON handling

Add an alternative json serialization and deserialization implementation
using simplejson configured to be JSON compliant by converting floats like
nan, +inf and -inf to null .
The idea is to permit users to use a different serialization if they
need a different behaviour.

Refs #1886

* client: fix overriding of transport json serializer

We get a string from config so need to import it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

2 participants