mirror of
https://github.com/apache/superset.git
synced 2024-09-12 08:39:45 -04:00
[bugfix] add support for numeric nodes in Sankey (#5154)
* [bugfix] add support for numeric nodes in Sankey closes https://github.com/apache/incubator-superset/issues/5142 * lint
This commit is contained in:
parent
5a716e9925
commit
b344056932
@ -31,6 +31,7 @@ from markdown import markdown
|
||||
import numpy as np
|
||||
import pandas as pd
|
||||
from pandas.tseries.frequencies import to_offset
|
||||
from past.builtins import basestring
|
||||
import polyline
|
||||
import simplejson as json
|
||||
from six import string_types, text_type
|
||||
@ -1596,6 +1597,8 @@ class SankeyViz(BaseViz):
|
||||
|
||||
def get_data(self, df):
|
||||
df.columns = ['source', 'target', 'value']
|
||||
df['source'] = df['source'].astype(basestring)
|
||||
df['target'] = df['target'].astype(basestring)
|
||||
recs = df.to_dict(orient='records')
|
||||
|
||||
hierarchy = defaultdict(set)
|
||||
|
Loading…
Reference in New Issue
Block a user