Skip to content

Commit

Permalink
Finish rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
Bogdan Kyryliuk committed Jan 6, 2017
1 parent 781450c commit f984b7a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
8 changes: 2 additions & 6 deletions superset/migrations/versions/1296d28ec131_druid_exports.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""empty message
"""Adds params to the datasource (druid) table
Revision ID: 1296d28ec131
Revises: e46f2d27a08e
Expand All @@ -8,19 +8,15 @@

# revision identifiers, used by Alembic.
revision = '1296d28ec131'
down_revision = 'e46f2d27a08e'
down_revision = '6414e83d82b7'

from alembic import op
import sqlalchemy as sa


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('datasources', sa.Column('params', sa.String(length=1000), nullable=True))
# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('datasources', 'params')
# ### end Alembic commands ###
8 changes: 2 additions & 6 deletions superset/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1571,16 +1571,15 @@ def get_druid_version(self):
).format(obj=self)
return json.loads(requests.get(endpoint).text)['version']

def refresh_datasources(self, datasource_name=None):
def refresh_datasources(self, datasource_name=None, merge_flag=False):
"""Refresh metadata of all datasources in the cluster
If ``datasource_name`` is specified, only that datasource is updated
"""
self.druid_version = self.get_druid_version()
for datasource in self.get_datasources():
if datasource not in config.get('DRUID_DATA_SOURCE_BLACKLIST'):
if not datasource_name or datasource_name == datasource:
DruidDatasource.sync_to_db(datasource, self)
DruidDatasource.sync_to_db(datasource, self, merge_flag)

@property
def perm(self):
Expand Down Expand Up @@ -1765,7 +1764,6 @@ class DruidMetric(Model, AuditMixinNullable, ImportMixin):
is_restricted = Column(Boolean, default=False, nullable=True)
d3format = Column(String(128))

<<<<<<< c2d29fb54bbe8e57bdee03f4f4940469b48c2a92
def refresh_datasources(self, datasource_name=None, merge_flag=False):
"""Refresh metadata of all datasources in the cluster
Expand All @@ -1776,7 +1774,6 @@ def refresh_datasources(self, datasource_name=None, merge_flag=False):
if datasource not in config.get('DRUID_DATA_SOURCE_BLACKLIST'):
if not datasource_name or datasource_name == datasource:
DruidDatasource.sync_to_db(datasource, self, merge_flag)
=======
export_fields = (
'metric_name', 'verbose_name', 'metric_type', 'datasource_name',
'json', 'description', 'is_restricted', 'd3format'
Expand All @@ -1789,7 +1786,6 @@ def json_obj(self):
except Exception:
obj = {}
return obj
>>>>>>> Druid dashboard import

@property
def perm(self):
Expand Down

0 comments on commit f984b7a

Please sign in to comment.