def import_obj(cls, i_metric): def lookup_obj(lookup_metric): return db.session.query(DruidMetric).filter( DruidMetric.datasource_name == lookup_metric.datasource_name, DruidMetric.metric_name == lookup_metric.metric_name).first() return import_util.import_simple_obj(db.session, i_metric, lookup_obj)
def import_obj(cls, i_column): def lookup_obj(lookup_column): return db.session.query(TableColumn).filter( TableColumn.table_id == lookup_column.table_id, TableColumn.column_name == lookup_column.column_name).first() return import_util.import_simple_obj(db.session, i_column, lookup_obj)
def import_obj(cls, i_column): def lookup_obj(lookup_column): return db.session.query(DruidColumn).filter( DruidColumn.datasource_name == lookup_column.datasource_name, DruidColumn.column_name == lookup_column.column_name).first() return import_util.import_simple_obj(db.session, i_column, lookup_obj)
def import_obj(cls, i_metric): def lookup_obj(lookup_metric): return db.session.query(SqlMetric).filter( SqlMetric.table_id == lookup_metric.table_id, SqlMetric.metric_name == lookup_metric.metric_name).first() return import_util.import_simple_obj(db.session, i_metric, lookup_obj)