mistercrunch commented on a change in pull request #4005: [BUGFIX]: Java
scripts max int is 2^53 - 1, longs are bigger
URL:
https://github.com/apache/incubator-superset/pull/4005#discussion_r159708275
##########
File path: superset/dataframe.py
##########
@@ -50,9 +52,17 @@ def size(self):
@property
def data(self):
# work around for https://github.com/pandas-dev/pandas/issues/18372
- return [dict((k, _maybe_box_datetimelike(v))
- for k, v in zip(self.__df.columns, np.atleast_1d(row)))
+ data = [dict((k, _maybe_box_datetimelike(v))
+ for k, v in zip(self.__df.columns, np.atleast_1d(row)))
for row in self.__df.values]
+ for d in data:
+ for k, v in list(d.items()):
+ # if an int is too big for Java Script to handle
+ # convert it to a string
+ if isinstance(v, int):
Review comment:
Good idea, `def handle_js_int_overflow(data)` or something
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services