Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add Indent Support in to_json #28130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Indent Support in to_json #28130
Changes from 33 commits
bb9c174
4c84106
b99f42b
367b494
1bcf354
43ab17b
592be66
5c0e8a3
d11e47f
21672ed
79c1cbc
0007e34
abdd27f
2da6fbf
a4f740a
cd0c9e6
c740359
2b5cb50
638d055
b870585
ba7f044
df589e3
517377b
4aec9d7
1aa424d
c896b8a
b046061
ae93309
f037d05
ccb9823
7d757e4
95251b1
65315c3
9827a94
0b440e0
0024f41
4869425
f03f05f
b894b8c
c4dba2e
dc68364
6da8684
dab8df1
b679fee
966fadb
c8efda6
5067eb7
f376f12
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this match the semantics of the stdlib, e.g. default is
None
and 0 means insert newlines, also can be a string, is that supported? https://docs.python.org/3/library/json.htmlThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No this only accepts int for now and 0 does not insert new lines. This matches ujson behavior instead of stdlib
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be possible to support this in the long term I just think will take a little bit of effort to bridge the gap with our vendored ujson. Thinking for now it might make the most sense to change the signature to
indent=None
and have that map toindent=0
, documenting the theindent=0
behavior is different from stdlib.I think that should avoid a deprecation cycle in the future for
indent=0
behavior if we eventually can mirror the stdlib's support