superset-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maximebeauche...@apache.org
Subject [incubator-superset] branch master updated: Return __time in Druid scan (#4504)
Date Fri, 09 Mar 2018 23:28:15 GMT
This is an automated email from the ASF dual-hosted git repository.

maximebeauchemin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git


The following commit(s) were added to refs/heads/master by this push:
     new 1647004  Return __time in Druid scan (#4504)
1647004 is described below

commit 16470044863555b42bfb2aaddecce68b589d0da1
Author: Beto Dealmeida <roberto@dealmeida.net>
AuthorDate: Fri Mar 9 15:28:11 2018 -0800

    Return __time in Druid scan (#4504)
    
    * Return __time in Druid scan
    
    * use constant instead of __timestamp
    
    * Fix lint
---
 superset/assets/visualizations/deckgl/layers/scatter.jsx | 2 +-
 superset/connectors/druid/models.py                      | 4 +++-
 superset/viz.py                                          | 2 +-
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/superset/assets/visualizations/deckgl/layers/scatter.jsx b/superset/assets/visualizations/deckgl/layers/scatter.jsx
index 087df3d..26d320c 100644
--- a/superset/assets/visualizations/deckgl/layers/scatter.jsx
+++ b/superset/assets/visualizations/deckgl/layers/scatter.jsx
@@ -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;
diff --git a/superset/connectors/druid/models.py b/superset/connectors/druid/models.py
index a16baf1..0541af0 100644
--- a/superset/connectors/druid/models.py
+++ b/superset/connectors/druid/models.py
@@ -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
diff --git a/superset/viz.py b/superset/viz.py
index 9225e5d..9bbf538 100644
--- a/superset/viz.py
+++ b/superset/viz.py
@@ -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):

-- 
To stop receiving notification emails like this one, please contact
maximebeauchemin@apache.org.

Mime
View raw message