diff --git a/app/models.py b/app/models.py index b7403ddd6..1a7630a0a 100644 --- a/app/models.py +++ b/app/models.py @@ -126,6 +126,7 @@ class Datasource(Model, AuditMixin): col_obj.filterable = True if col_obj: col_obj.type = cols[col]['type'] + col_obj.datasource = datasource col_obj.generate_metrics() #session.commit() @@ -199,7 +200,7 @@ class Column(Model, AuditMixin): json=json.dumps({'type': 'count', 'name': 'count'}) )) # Somehow we need to reassign this for UDAFs - corrected_type = 'DOUBLE' if self.type in ('DOUBLE', 'FLOAT') else 'self.type' + corrected_type = 'DOUBLE' if self.type in ('DOUBLE', 'FLOAT') else self.type if self.sum and self.isnum: mt = corrected_type.lower() + 'Sum' diff --git a/app/views.py b/app/views.py index 26c04b8bb..561802c18 100644 --- a/app/views.py +++ b/app/views.py @@ -74,10 +74,10 @@ class ClusterModelView(ModelView, DeleteMixin): appbuilder.add_view( ClusterModelView, - "Clusters", + "Druid Clusters", icon="fa-server", category="Admin", - category_icon='fa-envelope') + category_icon='fa-cogs',) class DatasourceModelView(ModelView, DeleteMixin): @@ -100,7 +100,7 @@ class DatasourceModelView(ModelView, DeleteMixin): appbuilder.add_view( DatasourceModelView, - "Datasources", + "Druid Datasources", icon="fa-cube", category_icon='fa-envelope') @@ -176,10 +176,11 @@ class Panoramix(BaseView): appbuilder.add_view_no_menu(Panoramix) appbuilder.add_link( - "Refresh Metadata", + "Refresh Druid Metadata", href='/panoramix/refresh_datasources/', category='Admin', - icon="fa-cogs") + category_icon='fa-cogs', + icon="fa-cog") #models.Metric.__table__.drop(db.engine) db.create_all()