Skip to content

[io][json] store inf, nan as strings and read them back properly#20128

Merged
linev merged 24 commits intoroot-project:masterfrom
ferdymercury:patch-23
Oct 20, 2025
Merged

[io][json] store inf, nan as strings and read them back properly#20128
linev merged 24 commits intoroot-project:masterfrom
ferdymercury:patch-23

Conversation

@ferdymercury
Copy link
Copy Markdown
Collaborator

Fixes #19768

@bellenot bellenot requested a review from linev October 16, 2025 14:39
@ferdymercury ferdymercury marked this pull request as ready for review October 16, 2025 14:52
@ferdymercury ferdymercury requested a review from pcanal as a code owner October 16, 2025 14:52
@ferdymercury
Copy link
Copy Markdown
Collaborator Author

I need some help with the Test. It works fine if I run it by copy-pasting it into the interpreter. So it seems like a missing dict that I did not manage to generate well in the scripted version.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Oct 16, 2025

Test Results

    22 files      22 suites   4d 1h 43m 44s ⏱️
 3 692 tests  3 645 ✅ 0 💤 47 ❌
79 270 runs  79 173 ✅ 0 💤 97 ❌

For more details on these failures, see this check.

Results for commit 73751b2.

♻️ This comment has been updated with latest results.

@ferdymercury ferdymercury requested a review from pcanal October 16, 2025 19:36
@linev
Copy link
Copy Markdown
Member

linev commented Oct 17, 2025

Proposed approach is not portable.

So any other JSON parser will fail completely parsing such string - and not only this single member.
JSON normally not used for objects I/O inside ROOT but rather for data exchange with other applications.

So provided solution can be used - but not by default.
One can provide special flag in compact argument to enable such feature.
See TBufferJSON.h around lines 35 - 48.
Something like kStoreInfinity = 500.
And then adjust TBufferJSON::SetCompact method.

@ferdymercury ferdymercury requested a review from linev October 17, 2025 10:05
@ferdymercury
Copy link
Copy Markdown
Collaborator Author

CI is finally green :)

Copy link
Copy Markdown
Member

@linev linev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks fine for me

@ferdymercury ferdymercury added this to the 6.38.00 milestone Oct 20, 2025
@linev linev merged commit 3f5a22f into root-project:master Oct 20, 2025
18 of 27 checks passed
@ferdymercury ferdymercury deleted the patch-23 branch October 20, 2025 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JSON output and infinity.

3 participants