本文整理汇总了Python中superset.connectors.druid.models.DruidDatasource.import_from_dict方法的典型用法代码示例。如果您正苦于以下问题:Python DruidDatasource.import_from_dict方法的具体用法?Python DruidDatasource.import_from_dict怎么用?Python DruidDatasource.import_from_dict使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类superset.connectors.druid.models.DruidDatasource
的用法示例。
在下文中一共展示了DruidDatasource.import_from_dict方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_import_druid_no_metadata
# 需要导入模块: from superset.connectors.druid.models import DruidDatasource [as 别名]
# 或者: from superset.connectors.druid.models.DruidDatasource import import_from_dict [as 别名]
def test_import_druid_no_metadata(self):
datasource, dict_datasource = self.create_druid_datasource(
'pure_druid', id=ID_PREFIX + 1)
imported_cluster = DruidDatasource.import_from_dict(db.session,
dict_datasource)
db.session.commit()
imported = self.get_datasource(imported_cluster.id)
self.assert_datasource_equals(datasource, imported)
示例2: test_import_druid_2_col_2_met
# 需要导入模块: from superset.connectors.druid.models import DruidDatasource [as 别名]
# 或者: from superset.connectors.druid.models.DruidDatasource import import_from_dict [as 别名]
def test_import_druid_2_col_2_met(self):
datasource, dict_datasource = self.create_druid_datasource(
'druid_2_col_2_met', id=ID_PREFIX + 3, cols_names=['c1', 'c2'],
metric_names=['m1', 'm2'])
imported_cluster = DruidDatasource.import_from_dict(db.session,
dict_datasource)
db.session.commit()
imported = self.get_datasource(imported_cluster.id)
self.assert_datasource_equals(datasource, imported)
示例3: test_import_druid_override_identical
# 需要导入模块: from superset.connectors.druid.models import DruidDatasource [as 别名]
# 或者: from superset.connectors.druid.models.DruidDatasource import import_from_dict [as 别名]
def test_import_druid_override_identical(self):
datasource, dict_datasource = self.create_druid_datasource(
'copy_cat', id=ID_PREFIX + 4,
cols_names=['new_col1', 'col2', 'col3'],
metric_names=['new_metric1'])
imported = DruidDatasource.import_from_dict(session=db.session,
dict_rep=dict_datasource)
db.session.commit()
copy_datasource, dict_cp_datasource = self.create_druid_datasource(
'copy_cat', id=ID_PREFIX + 4,
cols_names=['new_col1', 'col2', 'col3'],
metric_names=['new_metric1'])
imported_copy = DruidDatasource.import_from_dict(db.session,
dict_cp_datasource)
db.session.commit()
self.assertEquals(imported.id, imported_copy.id)
self.assert_datasource_equals(
copy_datasource, self.get_datasource(imported.id))
示例4: test_import_druid_1_col_1_met
# 需要导入模块: from superset.connectors.druid.models import DruidDatasource [as 别名]
# 或者: from superset.connectors.druid.models.DruidDatasource import import_from_dict [as 别名]
def test_import_druid_1_col_1_met(self):
datasource, dict_datasource = self.create_druid_datasource(
'druid_1_col_1_met', id=ID_PREFIX + 2,
cols_names=['col1'], metric_names=['metric1'])
imported_cluster = DruidDatasource.import_from_dict(db.session,
dict_datasource)
db.session.commit()
imported = self.get_datasource(imported_cluster.id)
self.assert_datasource_equals(datasource, imported)
self.assertEquals(
{DBREF: ID_PREFIX + 2, 'database_name': 'druid_test'},
json.loads(imported.params))
示例5: test_import_druid_override_append
# 需要导入模块: from superset.connectors.druid.models import DruidDatasource [as 别名]
# 或者: from superset.connectors.druid.models.DruidDatasource import import_from_dict [as 别名]
def test_import_druid_override_append(self):
datasource, dict_datasource = self.create_druid_datasource(
'druid_override', id=ID_PREFIX + 3, cols_names=['col1'],
metric_names=['m1'])
imported_cluster = DruidDatasource.import_from_dict(db.session,
dict_datasource)
db.session.commit()
table_over, table_over_dict = self.create_druid_datasource(
'druid_override', id=ID_PREFIX + 3,
cols_names=['new_col1', 'col2', 'col3'],
metric_names=['new_metric1'])
imported_over_cluster = DruidDatasource.import_from_dict(
db.session,
table_over_dict)
db.session.commit()
imported_over = self.get_datasource(imported_over_cluster.id)
self.assertEquals(imported_cluster.id, imported_over.id)
expected_datasource, _ = self.create_druid_datasource(
'druid_override', id=ID_PREFIX + 3,
metric_names=['new_metric1', 'm1'],
cols_names=['col1', 'new_col1', 'col2', 'col3'])
self.assert_datasource_equals(expected_datasource, imported_over)