Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

when try the Sankey visualization --An error occurred while rendering the visualization: TypeError: n.replace is not a function #5142

Closed
2 tasks
xzGithu opened this issue Jun 6, 2018 · 3 comments · Fixed by #5154

Comments

@xzGithu
Copy link

xzGithu commented Jun 6, 2018

Make sure these boxes are checked before submitting your issue - thank you!

  • I have checked the superset logs for python stacktraces and included it here as text if any
  • I have reproduced the issue with at least the latest released version of superset
  • [√] I have checked the issue tracker for the same issue and I haven't found one similar

Superset version

{"GIT_SHA": "", "version": "0.25.6"}

Expected results

wants to render a sankey visualization

Actual results

An error occurred while rendering the visualization: TypeError: n.replace is not a function

Steps to reproduce

I add one oracle ds and then add one table to visualize the sankey,
the log shows me :
2018-06-06 10:13:00,789:DEBUG:root:[stats_logger] (incr) loaded_from_source
2018-06-06 10:14:35,760:DEBUG:root:[stats_logger] (incr) explore
2018-06-06 10:14:38,219:DEBUG:root:[stats_logger] (incr) explore_json
2018-06-06 10:14:38,372:DEBUG:parsedatetime:eval now with context - False, False
2018-06-06 10:14:38,374:INFO:root:Cache key: 970010ac38299dc9a480a1de33a67
2018-06-06 10:14:38,378:INFO:root:Database.get_sqla_engine(). Masked URL: oracle://ultracmdb1:XXXXXXXXXX@192.168.18.9:1521/nms
2018-06-06 10:14:38,392:INFO:root:SELECT cis, cid, "SUM(linkcount)"
FROM (SELECT cis AS cis, cid AS cid, SUM(linkcount) AS "SUM(linkcount)"
FROM (select cis,cid,linkcount from ultracmdb1.app_link_counts where rownum<10) expr_qry GROUP BY cis, cid ORDER BY SUM(linkcount) DESC)
WHERE ROWNUM <= 100
2018-06-06 10:14:38,406:INFO:root:Database.get_sqla_engine(). Masked URL: oracle://ultracmdb1:XXXXXXXXXX@192.168.18.9:1521/nms
2018-06-06 10:14:38,498:DEBUG:root:[stats_logger] (incr) loaded_from_source
2018-06-06 10:14:38,599:DEBUG:root:[stats_logger] (incr) log
##########
but the web show me that error An error occurred while rendering the visualization: TypeError: n.replace is not a function

and the data i use like this
cis cid counts
50874 50733 60
50991 51081 30
50620 50645 24
51006 51213 18
50761 51069 15
51075 50810 15
51078 50843 12
51192 51091 12
51189 50878 3

@mistercrunch
Copy link
Member

I have not dug it but I think the sankey might [wrongfully] assume that input are strings. A workaround could be to create calculated columns that cast to string at the database level.

@xzGithu
Copy link
Author

xzGithu commented Jun 7, 2018

@mistercrunch yeah thanks, In the beginning i also think the int type can treat as the [source/target] but I am wrong ,when i cast it to string ,the sankey works.

@mistercrunch
Copy link
Member

Pushed a fix here: #5154

@xzGithu xzGithu closed this as completed Jun 11, 2018
mistercrunch added a commit that referenced this issue Jun 22, 2018
* [bugfix] add support for numeric nodes in Sankey

closes #5142

* lint
timifasubaa pushed a commit to airbnb/superset-fork that referenced this issue Jul 25, 2018
* [bugfix] add support for numeric nodes in Sankey

closes apache#5142

* lint
wenchma pushed a commit to wenchma/incubator-superset that referenced this issue Nov 16, 2018
* [bugfix] add support for numeric nodes in Sankey

closes apache#5142

* lint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants