@manager.option(u'-d', u'--datasource', help=u'Specify which datasource name to load, if omitted, all datasources will be refreshed')
@manager.option(u'-m', u'--merge', help=u"Specify using 'merge' property during operation. Default value is False ")
def refresh_druid(datasource, merge):
 session = db.session()
 from superset import models
 for cluster in session.query(models.DruidCluster).all():
  try:
   cluster.refresh_datasources(datasource_name=datasource, merge_flag=merge)
  except Exception as e:
   print(u"Error while processing cluster '{}'\n{}".format(cluster, str(e)))
   logging.exception(e)
  cluster.metadata_last_refreshed = datetime.now()
  print(((u'Refreshed metadata from cluster [' + cluster.cluster_name) + u']'))
 session.commit()

@ manager . option ( u'-d' , u'--datasource' , help = u'Specify which datasource name to load, if omitted, all datasources will be refreshed' ) @ manager . option ( u'-m' , u'--merge' , help = u"Specify using 'merge' property during operation. Default value is False " ) def refresh_druid ( datasource , merge ) : session = db . session ( ) from superset import models for cluster in session . query ( models . DruidCluster ) . all ( ) : try : cluster . refresh_datasources ( datasource_name = datasource , merge_flag = merge ) except Exception as e : print ( u"Error while processing cluster '{}'\n{}" . format ( cluster , str ( e ) ) ) logging . exception ( e ) cluster . metadata_last_refreshed = datetime . now ( ) print ( ( ( u'Refreshed metadata from cluster [' + cluster . cluster_name ) + u']' ) ) session . commit ( )
refresh druid datasources .