Upgrading pydruid version and adopt 'merge' flag during refresh_druid operation (#1879)

* Initial

* rewrite some line to make it short and setting merge variable temporarily

* rewrite commit author

* add emitted attribute

* Fix typo

* fix test error

* fix typo

* test added
This commit is contained in:
Dongkyu Hwangbo
2016-12-28 07:27:55 +09:00
committed by Maxime Beauchemin
parent 16731056ed
commit 3e6f90cf72
4 changed files with 18 additions and 8 deletions

View File

@@ -82,13 +82,19 @@ def load_examples(load_test_data):
help=(
"Specify which datasource name to load, if omitted, all "
"datasources will be refreshed"))
def refresh_druid(datasource):
@manager.option(
'-m', '--merge',
help=(
"Specify using 'merge' property during operation. "
"Default value is False "))
def refresh_druid(datasource, merge):
"""Refresh druid datasources"""
session = db.session()
from superset import models
for cluster in session.query(models.DruidCluster).all():
try:
cluster.refresh_datasources(datasource_name=datasource)
cluster.refresh_datasources(datasource_name=datasource,
merge_flag=merge)
except Exception as e:
print(
"Error while processing cluster '{}'\n{}".format(