Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cosmetricks #12

Merged
merged 2 commits into from
Aug 2, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion app/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ def sync_to_db(cls, name, cluster):
col_obj.filterable = True
if col_obj:
col_obj.type = cols[col]['type']
col_obj.datasource = datasource
col_obj.generate_metrics()
#session.commit()

Expand Down Expand Up @@ -199,7 +200,7 @@ def generate_metrics(self):
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'
Expand Down
11 changes: 6 additions & 5 deletions app/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -100,7 +100,7 @@ def post_update(self, datasource):

appbuilder.add_view(
DatasourceModelView,
"Datasources",
"Druid Datasources",
icon="fa-cube",
category_icon='fa-envelope')

Expand Down Expand Up @@ -176,10 +176,11 @@ def autocomplete(self, datasource, column):

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()