mirror of
https://github.com/apache/superset.git
synced 2024-09-12 16:49:40 -04:00
Return __time in Druid scan (#4504)
* Return __time in Druid scan * use constant instead of __timestamp * Fix lint
This commit is contained in:
parent
c6af4882cd
commit
1647004486
@ -14,7 +14,7 @@ import { unitToRadius } from '../../../javascripts/modules/geo';
|
||||
import sandboxedEval from '../../../javascripts/modules/sandbox';
|
||||
|
||||
function getStep(timeGrain) {
|
||||
// grain in microseconds
|
||||
// grain in milliseconds
|
||||
const MINUTE = 60 * 1000;
|
||||
const HOUR = 60 * MINUTE;
|
||||
const DAY = 24 * HOUR;
|
||||
|
@ -130,7 +130,8 @@ class DruidCluster(Model, AuditMixinNullable, ImportMixin):
|
||||
return json.loads(requests.get(endpoint).text)
|
||||
|
||||
def get_druid_version(self):
|
||||
endpoint = self.get_base_coordinator_url() + '/status'
|
||||
endpoint = self.get_base_url(
|
||||
self.coordinator_host, self.coordinator_port) + '/status'
|
||||
return json.loads(requests.get(endpoint).text)['version']
|
||||
|
||||
def refresh_datasources(
|
||||
@ -1114,6 +1115,7 @@ class DruidDatasource(Model, BaseDatasource):
|
||||
order_direction = 'descending' if order_desc else 'ascending'
|
||||
|
||||
if columns:
|
||||
columns.append('__time')
|
||||
del qry['post_aggregations']
|
||||
del qry['aggregations']
|
||||
qry['dimensions'] = columns
|
||||
|
@ -2039,7 +2039,7 @@ class DeckScatterViz(BaseDeckGLViz):
|
||||
'radius': self.fixed_value if self.fixed_value else d.get(self.metric),
|
||||
'cat_color': d.get(self.dim) if self.dim else None,
|
||||
'position': d.get('spatial'),
|
||||
'__timestamp': d.get('__timestamp'),
|
||||
'__timestamp': d.get(DTTM_ALIAS) or d.get('__time'),
|
||||
}
|
||||
|
||||
def get_data(self, df):
|
||||
|
Loading…
Reference in New Issue
Block a user