Skip to content

Commit

Permalink
[druid] Adding cluster filter for refresh
Browse files Browse the repository at this point in the history
  • Loading branch information
john-bodley committed Mar 12, 2018
1 parent 2bc089e commit 9604e1d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions superset/connectors/druid/models.py
Expand Up @@ -157,16 +157,15 @@ def refresh_datasources(

def refresh(self, datasource_names, merge_flag, refreshAll):
"""
Fetches metadata for the specified datasources andm
Fetches metadata for the specified datasources and
merges to the Superset database
"""
session = db.session
ds_list = (
session.query(DruidDatasource)
.filter(or_(DruidDatasource.datasource_name == name
for name in datasource_names))
.filter(DruidDatasource.cluster_name == self.cluster_name)
.filter(DruidDatasource.datasource_name.in_(datasource_names))
)

ds_map = {ds.name: ds for ds in ds_list}
for ds_name in datasource_names:
datasource = ds_map.get(ds_name, None)
Expand Down

0 comments on commit 9604e1d

Please sign in to comment.