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
Hi, I just came across this error when loading large integers where the integer extracted using orjson does not match the original large integer. Interestingly, the issue does not occur when loading the json file using json.
Here's the sample json file that I'm reading at "file.json":
This is the python code that I ran to compare the output between orjson and json. To highlight the issue, it occurs in the last 4 digits of the device tag that does not match the values in the original json file.
frompathlibimportPathimportjsonimportorjsonfp=Path('.') /"file.json"ojson_data=orjson.loads(fp.read_text())
ojson_deviceTag=ojson_data.get('locations')[0].get('deviceTag')
print(ojson_deviceTag ) # -8.024144696862913e+19json_data=json.loads(fp.read_text())
json_deviceTag=json_data.get('locations')[0].get('deviceTag')
print(json_deviceTag) # -80241446968629135069# The issue is more obvious when casting to intprint(int(ojson_deviceTag)) # -80241446968629133312
The text was updated successfully, but these errors were encountered:
Hi, I just came across this error when loading large integers where the integer extracted using
orjson
does not match the original large integer. Interestingly, the issue does not occur when loading the json file usingjson
.Here's the sample json file that I'm reading at "file.json":
This is the python code that I ran to compare the output between
orjson
andjson
. To highlight the issue, it occurs in the last 4 digits of the device tag that does not match the values in the original json file.The text was updated successfully, but these errors were encountered: