mirror of
https://github.com/apache/superset.git
synced 2024-09-12 00:29:39 -04:00
[hotfix] druid dist_bar viz issues with non-str x values
This commit is contained in:
parent
62987077fa
commit
ea189790f1
@ -1869,7 +1869,8 @@ class DruidDatasource(Model, AuditMixinNullable, Queryable):
|
||||
"""
|
||||
# TODO refactor into using a TBD Query object
|
||||
qry_start_dttm = datetime.now()
|
||||
|
||||
if not is_timeseries:
|
||||
granularity = 'all'
|
||||
inner_from_dttm = inner_from_dttm or from_dttm
|
||||
inner_to_dttm = inner_to_dttm or to_dttm
|
||||
|
||||
@ -1957,10 +1958,10 @@ class DruidDatasource(Model, AuditMixinNullable, Queryable):
|
||||
del qry['dimensions']
|
||||
client.timeseries(**qry)
|
||||
if len(groupby) == 1:
|
||||
if not timeseries_limit:
|
||||
timeseries_limit = 1000
|
||||
|
||||
qry['threshold'] = timeseries_limit
|
||||
qry['threshold'] = timeseries_limit or 1000
|
||||
if row_limit and granularity == 'all':
|
||||
qry['threshold'] = row_limit
|
||||
qry['dimension'] = list(qry.get('dimensions'))[0]
|
||||
del qry['dimensions']
|
||||
qry['metric'] = list(qry['aggregations'].keys())[0]
|
||||
|
@ -1382,7 +1382,7 @@ class DistributionBarViz(DistributionPieViz):
|
||||
d = {
|
||||
"key": series_title,
|
||||
"values": [
|
||||
{'x': i, 'y': v}
|
||||
{'x': str(i), 'y': v}
|
||||
for i, v in ys.iteritems()]
|
||||
}
|
||||
chart_data.append(d)
|
||||
|
Loading…
Reference in New Issue
Block a user