You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2019/04/24 15:24:39 UTC
[GitHub] [incubator-superset] elukey opened a new issue #7368: Histograms
broken with 0.32 due to new version of pydruid
elukey opened a new issue #7368: Histograms broken with 0.32 due to new version of pydruid
URL: https://github.com/apache/incubator-superset/issues/7368
After upgrading to 0.32 a histogram chart that worked on 0.31 doesn't render anymore due to a pydruid exception.
### Expected results
The histogram chart correctly visualized.
### Actual results
The following exception is thrown:
```
Traceback (most recent call last):
File "/srv/deployment/analytics/superset/venv/lib/python3.7/site-packages/superset/viz.py", line 410, in get_df_payload
df = self.get_df(query_obj)
File "/srv/deployment/analytics/superset/venv/lib/python3.7/site-packages/superset/viz.py", line 213, in get_df
self.results = self.datasource.query(query_obj)
File "/srv/deployment/analytics/superset/venv/lib/python3.7/site-packages/superset/connectors/druid/models.py", line 1287, in query
client=client, query_obj=query_obj, phase=2)
File "/srv/deployment/analytics/superset/venv/lib/python3.7/site-packages/superset/connectors/druid/models.py", line 884, in get_query_str
return self.run_query(client=client, phase=phase, **query_obj)
File "/srv/deployment/analytics/superset/venv/lib/python3.7/site-packages/superset/connectors/druid/models.py", line 1123, in run_query
client.scan(**qry)
File "/srv/deployment/analytics/superset/venv/lib/python3.7/site-packages/pydruid/client.py", line 559, in scan
query = self.query_builder.scan(kwargs)
File "/srv/deployment/analytics/superset/venv/lib/python3.7/site-packages/pydruid/query.py", line 445, in scan
self.validate_query(query_type, valid_parts, args)
File "/srv/deployment/analytics/superset/venv/lib/python3.7/site-packages/pydruid/query.py", line 265, in validate_query
.format(valid_parts))
ValueError: Query component: dimensions is not valid for query type: scan.The list of valid components is:
['datasource', 'granularity', 'filter', 'columns', 'metrics', 'intervals', 'limit', 'context']
```
This is due to the following change in pydruid:
https://github.com/druid-io/pydruid/commit/0a59a70829bafc85951d05c49efb571f9f51e557
That got released in 0.5.2 (the version stated in 0.32's requirement.txt).
I have fixed it with the following code:
```
--- a/superset/connectors/druid/models.py
+++ b/superset/connectors/druid/models.py
@@ -1119,7 +1119,8 @@ class DruidDatasource(Model, BaseDatasource):
columns.append('__time')
del qry['post_aggregations']
del qry['aggregations']
- qry['dimensions'] = columns
+ del qry['dimensions']
+ qry['columns'] = columns
qry['metrics'] = []
qry['granularity'] = 'all'
qry['limit'] = row_limit
```
### Environment
(please complete the following information):
- superset version: 0.32rc2
- python version: 3.7
### Checklist
Make sure these boxes are checked before submitting your issue - thank you!
- [x] I have checked the superset logs for python stacktraces and included it here as text if there are any.
- [x] I have reproduced the issue with at least the latest released version of superset.
- [x] I have checked the issue tracker for the same issue and I haven't found one similar.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org