Skip to content

Instantly share code, notes, and snippets.

@isc-rsingh
Last active January 4, 2017 16:09
Show Gist options
  • Save isc-rsingh/efcb98adf60e936c032a427884b332ce to your computer and use it in GitHub Desktop.
Save isc-rsingh/efcb98adf60e936c032a427884b332ce to your computer and use it in GitHub Desktop.
pixiedust __init__.py in dir display/table
@PixiedustDisplay(isDefault=True)
class TableDisplayMeta(DisplayHandlerMeta):
@addId
def getMenuInfo(self,entity, dataHandler):
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 []
def newDisplayHandler(self,options,entity):
return TableDisplay(options,entity)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment