File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change 13
13
'float64' : 'f8'
14
14
}
15
15
16
+ int32bounds = numpy .iinfo (numpy .int32 )
17
+ uint32bounds = numpy .iinfo (numpy .uint32 )
18
+
16
19
# List mainly including keys with type of 'info_array'
17
20
# Simply having two items the b64 option is not supported by plotly.js
18
21
# This list also includes cases of type 'any' that we don't to be converted
@@ -73,8 +76,16 @@ def arraysToB64(obj, newObj) :
73
76
74
77
# convert Big Ints until we could support them in plotly.js
75
78
if str (arr .dtype ) == 'int64' :
79
+ if arr .max () > int32bounds .max or arr .min () < int32bounds .min :
80
+ newObj [key ] = val
81
+ continue
82
+
76
83
arr = arr .astype (numpy .int32 )
77
84
elif str (arr .dtype ) == 'uint64' :
85
+ if arr .max () > uint32bounds .max or arr .min () < uint32bounds .min :
86
+ newObj [key ] = val
87
+ continue
88
+
78
89
arr = arr .astype (numpy .uint32 )
79
90
80
91
if str (arr .dtype ) in plotlyjsTypes :
You can’t perform that action at this time.
0 commit comments