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

Explore option in viz shows "Empty Query" error #10215

Closed
3 tasks done
shashisingh opened this issue Jul 1, 2020 · 6 comments · Fixed by #10219
Closed
3 tasks done

Explore option in viz shows "Empty Query" error #10215

shashisingh opened this issue Jul 1, 2020 · 6 comments · Fixed by #10219
Labels
!deprecated-label:bug Deprecated label - Use #bug instead

Comments

@shashisingh
Copy link

shashisingh commented Jul 1, 2020

I built docker image from the code in master branch. I followed following steps to build and start docker container.

  1. docker build -f superset:test -f Dockerfile .
  2. docker run -d -p 10088:8080 -v /home/ubuntu/ssConfig:/app/pythonpath --health-cmd='curl -f localhost:8080' --name superset_test superset:test
  3. docker exec -it superset_test superset fab create-admin --username admin --firstname Superset --lastname Admin --email admin@superset.com --password XXXXX
  4. docker exec -it superset_test superset db upgrade
  5. docker exec -it superset_test superset init

/home/ubuntu/ssConfig -> contains superset_config.py where I set DRUID_IS_ACTIVE to True and SQLALCHEMY_DATABASE_URI pointing to a postgres database.

After this I created a database that is setup to query druid broker. I input a group by query similar to the following -> SELECT eventId , eventType, COUNT(*) as counter FROM "druid_datasource_name" GROUP BY("eventId","eventType"); I can see the results in SQLTab. I clicked on "Explore" option to open visualization window.

Additional Tests =>

I tried the query SELECT country_code ,COUNT(*) as entries from wb_health_population GROUP BY("country_code"); -> included in examples. And then clicked on "Explore" in "Results" tab. I have attached a screenshot.

Expected results

I should see a table displayed in the visualization area.

Actual results

I see an error that says "Empty query?".

Stack Trace is shown below ---

Traceback (most recent call last):
File "/app/superset/viz.py", line 463, in get_df_payload
df = self.get_df(query_obj)
File "/app/superset/viz.py", line 240, in get_df
self.results = self.datasource.query(query_obj)
File "/app/superset/connectors/sqla/models.py", line 1128, in query
query_str_ext = self.get_query_str_extended(query_obj)
File "/app/superset/connectors/sqla/models.py", line 655, in get_query_str_extended
sqlaq = self.get_sqla_query(**query_obj)
File "/app/superset/connectors/sqla/models.py", line 798, in get_sqla_query
raise Exception(_("Empty query?"))
Exception: Empty query?

Environment

Environment
• superset version: 0.999.0dev
• python version: 3.6.10
• node.js version: 13.6.0
• npm version: 6.13.4

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.

EmptyQuerySupersetExamples

@shashisingh shashisingh added the !deprecated-label:bug Deprecated label - Use #bug instead label Jul 1, 2020
@issue-label-bot
Copy link

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

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

@dpgaspar
Copy link
Member

dpgaspar commented Jul 1, 2020

Hi @shashanksingh,

Thank you for taking the time to report this issue. I'm able to reproduce.

Investigating

@shashanksingh
Copy link
Contributor

@dpgaspar thanks for that man, but I think the reporter, @shashisingh is a different human being :D

@dpgaspar
Copy link
Member

dpgaspar commented Jul 1, 2020

ups! sorry for that @shashanksingh

@dpgaspar
Copy link
Member

dpgaspar commented Jul 1, 2020

I think this was introduced here: #10113, still investigating

Seems like that when using explore from SQLLab we have this issue, but if we explore from the datasets list view using the created virtual dataset the charts render correctly

from SQLLab:
expore_json/ returns 400

form_data:

{"queryFields":{"groupby":"groupby","metrics":"metrics"},"datasource":"37__table","viz_type":"table","time_range_endpoints":["inclusive","exclusive"],"granularity_sqla":"last_login","time_grain_sqla":"P1D","time_range":"No filter","query_mode":"aggregate","groupby":[],"metrics":[],"all_columns":["id","first_name","last_name","username","password","active","email","last_login","login_count","fail_login_count","created_on","changed_on","created_by_fk","changed_by_fk"],"percent_metrics":[],"timeseries_limit_metric":null,"order_by_cols":[],"row_limit":1000,"include_time":false,"order_desc":true,"adhoc_filters":[],"table_timestamp_format":"smart_date","page_length":null,"include_search":false,"table_filter":false,"align_pn":false,"color_pn":true,"show_cell_bars":true}

from datasets list:

{"queryFields":{"groupby":"groupby","metrics":"metrics"},"datasource":"37__table","viz_type":"table","url_params":{},"time_range_endpoints":["inclusive","exclusive"],"granularity_sqla":"last_login","time_grain_sqla":"P1D","time_range":"Last week","query_mode":"aggregate","groupby":[],"metrics":["count"],"all_columns":[],"percent_metrics":[],"timeseries_limit_metric":null,"order_by_cols":[],"row_limit":10000,"include_time":false,"order_desc":true,"adhoc_filters":[],"table_timestamp_format":"smart_date","page_length":null,"include_search":false,"table_filter":false,"align_pn":false,"color_pn":true,"show_cell_bars":true}

missing the "metrics":["count"] on the first request

@ktmud can you take a look?

@ktmud
Copy link
Member

ktmud commented Jul 1, 2020

Fixed by apache-superset/superset-ui#659 and #10219. Sorry for the inconvenience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
!deprecated-label:bug Deprecated label - Use #bug instead
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants