-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
fix to_json for numbers larger than sys.maxsize #34473
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
Merged
Merged
Changes from all commits
Commits
Show all changes
86 commits
Select commit
Hold shift + click to select a range
95c20db
BUG: overflow on to_json with numbers larger than sys.maxsize
arw2019 6d2f8bd
TST: overflow on to_json with numbers larger than sys.maxsize (#34395)
arw2019 4fc5b87
DOC: update with issue #34395
arw2019 abfca37
TST: removed unused import
arw2019 7e63941
ENH: added case JT_BIGNUM to encode
arw2019 3353420
ENH: added JT_BIGNUM to JSTYPES
arw2019 c9574b8
BUG: changed error for ints>sys.maxsize into JT_BIGNUM
arw2019 94c112f
ENH: removed debug statements
arw2019 76576b8
BUG: removed dumps wrapper
arw2019 9f211a5
removed bigNum from TypeContext
arw2019 2b7a271
TST: fixed bug in the test
arw2019 5e06109
added pointer to string rep converter for BigNum
arw2019 755ef47
TST: removed ujson.loads from the test
arw2019 0e768f8
added getBigNumStringValue
arw2019 12d73b0
added code to JT_BIGNUM handler by analogy with JT_UTF8
arw2019 6c2aa9f
TST: update pandas/tests/io/json/test_ujson.py
arw2019 1a8051f
added Object_getBigNumStringValue to pyEncoder
arw2019 552194e
added skeletal code for Object_GetBigNumStringValue
arw2019 e2898ef
completed Object_getBigNumStringValue using PyObject_Repr
arw2019 2943995
BUG: changed Object_getBigNumStringValue
arw2019 771ec5d
improved Object_getBigNumStringValue some more
arw2019 92bc6ef
update getBigNumStringValue argument
arw2019 8f3af8c
corrected Object_getBigNumStringValue
arw2019 cdae92e
more fixes to Object_getBigNumStringValue
arw2019 1009168
Update pandas/_libs/src/ujson/python/objToJSON.c
arw2019 759ad8a
Update pandas/_libs/src/ujson/python/objToJSON.c
arw2019 5e01ed0
Update pandas/_libs/src/ujson/python/objToJSON.c
arw2019 8a08a38
Update pandas/_libs/src/ujson/python/objToJSON.c
arw2019 0441fe7
Update pandas/_libs/src/ujson/python/objToJSON.c
arw2019 4630c0d
Update pandas/_libs/src/ujson/python/objToJSON.c
arw2019 2e06a8b
Update pandas/_libs/src/ujson/python/objToJSON.c
arw2019 63056fc
Update pandas/_libs/src/ujson/python/objToJSON.c
arw2019 6ec960e
updated pyEncoder for JT_BIGNUM
arw2019 c63a5c9
updated pyEncoder
arw2019 b2f8f46
moved getBigNumStringValue to pyEncoder
arw2019 fea9348
fixed declaration of Object_getBigNumStringValue
arw2019 6516078
fixed Object_getBigNumStringValue
arw2019 aa2dbca
catch overflow error with PyLong_AsLongLongAndOverflow
arw2019 7eaf42d
remove unnecessary error check
arw2019 56d5bac
added shortcircuit for error check
arw2019 1cdb1ba
simplify int overflow error catching
arw2019 821d51f
Update long int test in pandas/tests/io/json/test_ujson.py
arw2019 1001ac1
removed tests expecting numeric overflow
arw2019 b8f16b6
remove underscore from overflow
arw2019 a6e83c7
removed underscores from _overflow everywhere
arw2019 ccc5b47
fixed small typo
arw2019 585b985
fix type of exc
arw2019 7586698
deleted numeric overflow tests
arw2019 0e6768f
remove extraneous condition in if statement
arw2019 7c19bd2
remove extraneous condition in if statement
arw2019 9809d7c
change _Bool into int
arw2019 2739f3d
Update pandas/_libs/src/ujson/python/objToJSON.c
arw2019 77d69b7
Update pandas/_libs/src/ujson/lib/ultrajsonenc.c
arw2019 f003d6b
allocate an extra byte in Object_getBigNumStringValue
arw2019 ee505c9
allocate an extra byte in Object_getBigNumStringValue
arw2019 cdc0870
reinstate RESERVE_STRING(szlen) in JT_BIGNUM case
arw2019 0fba3d5
replaced (private) with (public) in whatnew
arw2019 259018d
release bytes in Object_endTypeContext
arw2019 a856a41
in JT_BIGNUM change if+if into if+else if
arw2019 1bbfdc2
added reallocation of bigNum_bytes
arw2019 665b146
removed bigNum_bytes
arw2019 3608297
added to_json test for ints>sys.maxsize
arw2019 4ab13d6
Merge branch 'master' into json-Overflow-long-int
arw2019 176f212
Use python malloc to match PyObject_Free in endTypeContext
arw2019 9b58758
TST: added manually constructed strs to compare encodings
arw2019 44b79f1
resolve conflicts with master
arw2019 9cbf596
fixed styling to minimize diff with master
arw2019 7ee21eb
fixed styling
arw2019 948170c
pandas/_libs/src/ujson/python/objToJSON.c
arw2019 ff2e25e
fixed conflicts with master
arw2019 ce37048
fix styling to minimize diff
arw2019 2db12c0
fix styling to minimize diff
arw2019 3e820ac
fixed styling
arw2019 7afeadb
added negative nigNum to test_to_json_large_numers
arw2019 e4df0f8
added negative nigNum to test_to_json_large_numers
arw2019 7b041fe
Update pandas/tests/io/json/test_ujson.py
arw2019 21d9e98
fixe test_to_json_for_large_nums for -ve
arw2019 6fd15c9
merge with master
arw2019 c7acef1
merged with master
arw2019 2d43001
TST: added xfail for ujson.encode with long int input
arw2019 6053227
TST: fixed variable names in test_to_json_large_numbers
arw2019 a688468
TST: added xfail test for json.decode Series with long int
arw2019 9e1b95f
TST: added xfail test for json.decode DataFrame with long int
arw2019 cc0dd6a
merge with master
arw2019 4e53974
BENCH: added benchmarks for long ints
arw2019 5c96ae4
Merge branch 'master' into json-Overflow-long-int
arw2019 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
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.
@jreback Not sure where we want the
longints
to go - whether intoints
or separately. I would think we also want to make sure we have both positive and negative long ints in there?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.
this prob fine