superset: SQL Lab does not show table names in the dropdown box

A clear and concise description of what the bug is. While selecting Database, schema, and table to inspect the table structure, I noticed that the table dropdown box only shows the schema name, not the table name. If I try selecting any of the options, I get an An error occurred while fetching table metadata error.

Expected results

I can see the columns that belong to the table

Actual results

An An error occurred while fetching table metadata error message appear

Screenshots

https://imgur.com/tfSfvyg

How to reproduce the bug

  1. Go to ‘SQL Lab > SQL Editor’
  2. Click on any Database in the dropdown box
  3. After refreshing the schema dropdown box, select any schema with tables
  4. Check the tables dropdown box. It should appear only the schema name, not the tables name

Environment

  • superset version: 0.37.1
  • python version: Python 3.6.12
  • node.js version: N/A
  • npm version: N/A

Checklist

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 there are 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.

Additional context

N/A

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 20 (5 by maintainers)

Most upvoted comments

Issue-Label Bot is automatically applying the label #bug to this issue, with a confidence of 0.96. Please mark this comment with 👍 or 👎 to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

It is a bug in pyhive:

https://github.com/dropbox/PyHive/blob/master/pyhive/sqlalchemy_hive.py#L364

That line should not return row[0] since the result will be the schema name, not the table name. I’m going to propose a fix in pyhive.

Meanwhile, can this issue keep opened until pyhive team accept and fixes in latest releases?

Edit: Problem is even worse. See https://github.com/dropbox/PyHive/issues/146 I’ll see how to workaround this.

Tracking requests from Superset UI, I see that when you select a Database the following URL is requested:

http://<superset-hostname><:superset_port>/superset/schemas/1/false/

Which returns a JSON with the following contents and populates the Schema selector:

{"schemas": ["main","examples"]} # This is just an example JSON output returned

When you select any schema, the following URL is requested:

http://<superset-hostname><:superset_port>/superset/tables/1/main/undefined/false/

This undefined in the URL clearly indicates that the Schema selector is not building the component correctly.

I’m still debugging the code and if I have a fix I’ll cook a PR for it. Stay tuned!

Edited: hmm, so undefined seems acceptable but anyways the code that responds for that URL seems the issue. Still investigating.