Skip to content

Commit

Permalink
Fixing druid metadata import
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch committed Feb 12, 2016
1 parent 1f41ce3 commit 6f4397c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions panoramix/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -862,6 +862,7 @@ def generate_metrics(self):

@classmethod
def sync_to_db(cls, name, cluster):
print("Syncing Druid datasource [{}]".format(name))
session = get_session()
datasource = session.query(cls).filter_by(datasource_name=name).first()
if not datasource:
Expand Down Expand Up @@ -1078,7 +1079,7 @@ def json_obj(self):
return obj


class DruidColumn(Model, AuditMixinNullable):
class DruidColumn(Model):
__tablename__ = 'columns'
id = Column(Integer, primary_key=True)
datasource_name = Column(
Expand Down Expand Up @@ -1121,7 +1122,7 @@ def generate_metrics(self):
if self.sum and self.isnum:
mt = corrected_type.lower() + 'Sum'
name = 'sum__' + self.column_name
metrics.append(Metric(
metrics.append(DruidMetric(
metric_name=name,
metric_type='sum',
verbose_name='SUM({})'.format(self.column_name),
Expand Down

0 comments on commit 6f4397c

Please sign in to comment.