def getMenuInfo(self, entity, dataHandler):
     if dataHandler is not None:
         entity = dataHandler.entity
     if dataFrameMisc.isPySparkDataFrame(
             entity) or dataFrameMisc.isPandasDataFrame(entity):
         return [{
             "categoryId": "Table",
             "title": "DataFrame Table",
             "icon": "fa-table",
             "id": "dataframe"
         }]
     elif dataFrameMisc.fqName(
             entity) == "graphframes.graphframe.GraphFrame":
         return [{
             "categoryId": "Table",
             "title": "Graph Vertices",
             "icon": "fa-location-arrow",
             "id": "vertices"
         }, {
             "categoryId": "Table",
             "title": "Graph Edges",
             "icon": "fa-link",
             "id": "edges"
         }]
     else:
         return []
Example #2
0
 def getMenuInfo(self,entity, dataHandler):
     if dataHandler is not None:
         entity = dataHandler.entity
     if dataFrameMisc.isPySparkDataFrame(entity) or dataFrameMisc.isPandasDataFrame(entity):
         return [
             {"categoryId": "Table", "title": "DataFrame Table", "icon": "fa-table", "id": "dataframe"}
         ]
     elif dataFrameMisc.fqName(entity) == "graphframes.graphframe.GraphFrame":
         return [
             {"categoryId": "Table", "title": "Graph Vertices", "icon": "fa-location-arrow", "id":"vertices"},
             {"categoryId": "Table", "title": "Graph Edges", "icon": "fa-link", "id":"edges"}
         ]
     else:
         return []
Example #3
0
 def doRender(self, handlerId):
     entity=self.entity       
     if dataFrameMisc.fqName(entity) == "graphframes.graphframe.GraphFrame":
         if handlerId == "edges":
             entity=entity.edges
         else:
             entity=entity.vertices
     if dataFrameMisc.isPySparkDataFrame(entity) or dataFrameMisc.isPandasDataFrame(entity):
         self._addHTMLTemplate('dataframeTable.html', entity=PandasDataFrameAdapter(entity))
         return
         
     self._addHTML("""
         <b>Unable to display object</b>
     """
     )
Example #4
0
   def doRender(self, handlerId):
       entity=self.entity       
       if dataFrameMisc.fqName(entity) == "graphframes.graphframe.GraphFrame":
           if handlerId == "edges":
               entity=entity.edges
           else:
               entity=entity.vertices
       if dataFrameMisc.isPySparkDataFrame(entity) or dataFrameMisc.isPandasDataFrame(entity):
           self.hideColumns = self.options.get("hideColumns") and [a.strip() for a in self.options.get("hideColumns").split(",")]
           self.showColumns = self.options.get("showColumns") and [a.strip() for a in self.options.get("showColumns").split(",")]
           self._addHTMLTemplate('dataframeTable.html', entity=PandasDataFrameAdapter(entity), table_noschema=self.options.get("table_noschema", "false"))
           return
 
       self._addHTML("""
           <b>Unable to display object {}</b>
       """.format(entity)
       )
Example #5
0
    def doRender(self, handlerId):
        entity = self.entity
        if dataFrameMisc.fqName(entity) == "graphframes.graphframe.GraphFrame":
            if handlerId == "edges":
                entity = entity.edges
            else:
                entity = entity.vertices
        if dataFrameMisc.isPySparkDataFrame(
                entity) or dataFrameMisc.isPandasDataFrame(entity):
            hcmap = {}
            if "hideColumns" in self.options:
                hcarr = self.options.get("showColumns").split(",")
                for s in hcarr:
                    hcmap[s] = 1
            self._addHTMLTemplate('dataframeTable.html',
                                  entity=PandasDataFrameAdapter(entity),
                                  table_noschema=self.options.get(
                                      "table_noschema", "false"),
                                  table_hidecols=hcmap)
            return

        self._addHTML("""
            <b>Unable to display object {}</b>
        """.format(entity))