You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix to_json for numbers larger than sys.maxsize (#34473)
* BUG: overflow on to_json with numbers larger than sys.maxsize
* TST: overflow on to_json with numbers larger than sys.maxsize (#34395)
* DOC: update with issue #34395
* TST: removed unused import
* ENH: added case JT_BIGNUM to encode
* ENH: added JT_BIGNUM to JSTYPES
* BUG: changed error for ints>sys.maxsize into JT_BIGNUM
* ENH: removed debug statements
* BUG: removed dumps wrapper
* removed bigNum from TypeContext
* TST: fixed bug in the test
* added pointer to string rep converter for BigNum
* TST: removed ujson.loads from the test
* added getBigNumStringValue
* added code to JT_BIGNUM handler by analogy with JT_UTF8
* TST: update pandas/tests/io/json/test_ujson.py
Co-authored-by: William Ayd <[email protected]>
* added Object_getBigNumStringValue to pyEncoder
* added skeletal code for Object_GetBigNumStringValue
* completed Object_getBigNumStringValue using PyObject_Repr
* BUG: changed Object_getBigNumStringValue
* improved Object_getBigNumStringValue some more
* update getBigNumStringValue argument
* corrected Object_getBigNumStringValue
* more fixes to Object_getBigNumStringValue
* Update pandas/_libs/src/ujson/python/objToJSON.c
Co-authored-by: William Ayd <[email protected]>
* Update pandas/_libs/src/ujson/python/objToJSON.c
Co-authored-by: William Ayd <[email protected]>
* Update pandas/_libs/src/ujson/python/objToJSON.c
Co-authored-by: William Ayd <[email protected]>
* Update pandas/_libs/src/ujson/python/objToJSON.c
Co-authored-by: William Ayd <[email protected]>
* Update pandas/_libs/src/ujson/python/objToJSON.c
Co-authored-by: William Ayd <[email protected]>
* Update pandas/_libs/src/ujson/python/objToJSON.c
Co-authored-by: William Ayd <[email protected]>
* Update pandas/_libs/src/ujson/python/objToJSON.c
* Update pandas/_libs/src/ujson/python/objToJSON.c
* updated pyEncoder for JT_BIGNUM
* updated pyEncoder
* moved getBigNumStringValue to pyEncoder
* fixed declaration of Object_getBigNumStringValue
* fixed Object_getBigNumStringValue
* catch overflow error with PyLong_AsLongLongAndOverflow
* remove unnecessary error check
* added shortcircuit for error check
* simplify int overflow error catching
Co-authored-by: William Ayd <[email protected]>
* Update long int test in pandas/tests/io/json/test_ujson.py
Co-authored-by: William Ayd <[email protected]>
* removed tests expecting numeric overflow
* remove underscore from overflow
Co-authored-by: William Ayd <[email protected]>
* removed underscores from _overflow everywhere
* fixed small typo
* fix type of exc
* deleted numeric overflow tests
* remove extraneous condition in if statement
Co-authored-by: William Ayd <[email protected]>
* remove extraneous condition in if statement
Co-authored-by: William Ayd <[email protected]>
* change _Bool into int
Co-authored-by: William Ayd <[email protected]>
* Update pandas/_libs/src/ujson/python/objToJSON.c
Co-authored-by: William Ayd <[email protected]>
* Update pandas/_libs/src/ujson/lib/ultrajsonenc.c
Co-authored-by: William Ayd <[email protected]>
* allocate an extra byte in Object_getBigNumStringValue
Co-authored-by: William Ayd <[email protected]>
* allocate an extra byte in Object_getBigNumStringValue
Co-authored-by: William Ayd <[email protected]>
* reinstate RESERVE_STRING(szlen) in JT_BIGNUM case
* replaced (private) with (public) in whatnew
* release bytes in Object_endTypeContext
* in JT_BIGNUM change if+if into if+else if
* added reallocation of bigNum_bytes
* removed bigNum_bytes
* added to_json test for ints>sys.maxsize
* Use python malloc to match PyObject_Free in endTypeContext
Co-authored-by: William Ayd <[email protected]>
* TST: added manually constructed strs to compare encodings
* fixed styling to minimize diff with master
* fixed styling
* fixed conflicts with master
* fix styling to minimize diff
* fix styling to minimize diff
* fixed styling
* added negative nigNum to test_to_json_large_numers
* added negative nigNum to test_to_json_large_numers
* Update pandas/tests/io/json/test_ujson.py
Co-authored-by: William Ayd <[email protected]>
* fixe test_to_json_for_large_nums for -ve
* TST: added xfail for ujson.encode with long int input
* TST: fixed variable names in test_to_json_large_numbers
* TST: added xfail test for json.decode Series with long int
* TST: added xfail test for json.decode DataFrame with long int
* BENCH: added benchmarks for long ints
Co-authored-by: William Ayd <[email protected]>
Copy file name to clipboardExpand all lines: doc/source/whatsnew/v1.1.0.rst
+1
Original file line number
Diff line number
Diff line change
@@ -1026,6 +1026,7 @@ I/O
1026
1026
- Bug in :meth:`~pandas.io.stata.StataReader` which resulted in categorical variables with difference dtypes when reading data using an iterator. (:issue:`31544`)
1027
1027
- :meth:`HDFStore.keys` has now an optional `include` parameter that allows the retrieval of all native HDF5 table names (:issue:`29916`)
1028
1028
- Bug in :meth:`read_excel` for ODS files removes 0.0 values (:issue:`27222`)
1029
+
- Bug in :meth:`ujson.encode` was raising an `OverflowError` with numbers larger than sys.maxsize (:issue: `34395`)
0 commit comments