You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ma...@apache.org on 2018/06/22 01:09:10 UTC
[incubator-superset] branch master updated: [bugfix] add support
for numeric nodes in Sankey (#5154)
This is an automated email from the ASF dual-hosted git repository.
maximebeauchemin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git
The following commit(s) were added to refs/heads/master by this push:
new b344056 [bugfix] add support for numeric nodes in Sankey (#5154)
b344056 is described below
commit b344056932e3247d16ccb4f6a3af9e78cf0549e3
Author: Maxime Beauchemin <ma...@gmail.com>
AuthorDate: Thu Jun 21 18:09:08 2018 -0700
[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
---
superset/viz.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/superset/viz.py b/superset/viz.py
index cd11709..f3c7b15 100644
--- a/superset/viz.py
+++ b/superset/viz.py
@@ -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)