Pārlūkot izejas kodu

[spark] Offer graphing to Spark snippets

Romain Rigaux 10 gadi atpakaļ
vecāks
revīzija
8469b5e706

+ 2 - 2
apps/spark/src/spark/models.py

@@ -336,10 +336,10 @@ class SparkApi():
       try:
         table = data['application/vnd.livy.table.v1+json']
         data = table['data']
-        meta = [{'name': name, 'type': 'String', 'comment': ''} for name in table['headers']]
+        meta = [{'name': name, 'type': 'INT_TYPE', 'comment': ''} for name in table['headers']]
       except KeyError:
         data = [[data['text/plain']]]
-        meta = [{'name': 'Header', 'type': 'String', 'comment': ''}]
+        meta = [{'name': 'Header', 'type': 'INT_TYPE', 'comment': ''}]
 
       # start_over not supported
       if not start_over:

+ 1 - 1
apps/spark/src/spark/templates/editor.mako

@@ -334,7 +334,7 @@ ${ commonheader(_('Query'), app_name, user, "68px") | n,unicode }
           <button data-bind="visible: result.hasSomeResults(), click: function() { $data.showGrid(true); }, css: {'active': $data.showGrid}" href="javascript:void(0)" class="btn" title="${ _('Grid') }">
             <i class="fa fa-th"></i>
           </button>
-          <div class="btn-group" data-bind="visible: type() != 'scala' && type() != 'python' && result.hasSomeResults()">
+          <div class="btn-group" data-bind="visible: result.hasSomeResults()">
             <button class="btn" data-bind="css: {'active': $data.showChart}, click: function(){ $data.showChart(true); }">
               <i class="hcha hcha-bar-chart" data-bind="visible: chartType() == ko.HUE_CHARTS.TYPES.BARCHART"></i>
               <i class="hcha hcha-line-chart" data-bind="visible: chartType() == ko.HUE_CHARTS.TYPES.LINECHART"></i>