Skip to content

Commit

Permalink
Deprecate is_featured as a datasource attribute (#2485)
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch authored Mar 31, 2017
1 parent b81968d commit abe79d1
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 16 deletions.
2 changes: 1 addition & 1 deletion superset/connectors/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class BaseDatasource(AuditMixinNullable, ImportMixin):
id = Column(Integer, primary_key=True)
description = Column(Text)
default_endpoint = Column(Text)
is_featured = Column(Boolean, default=False)
is_featured = Column(Boolean, default=False) # TODO deprecating
filter_select_enabled = Column(Boolean, default=False)
offset = Column(Integer, default=0)
cache_timeout = Column(Integer)
Expand Down
2 changes: 1 addition & 1 deletion superset/connectors/druid/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ class DruidDatasource(Model, BaseDatasource):

export_fields = (
'datasource_name', 'is_hidden', 'description', 'default_endpoint',
'cluster_name', 'is_featured', 'offset', 'cache_timeout', 'params'
'cluster_name', 'offset', 'cache_timeout', 'params'
)

@property
Expand Down
3 changes: 1 addition & 2 deletions superset/connectors/druid/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ class DruidDatasourceModelView(SupersetModelView, DeleteMixin): # noqa
related_views = [DruidColumnInlineView, DruidMetricInlineView]
edit_columns = [
'datasource_name', 'cluster', 'description', 'owner',
'is_featured', 'is_hidden',
'is_hidden',
'filter_select_enabled', 'fetch_values_from',
'default_endpoint', 'offset', 'cache_timeout']
add_columns = edit_columns
Expand All @@ -174,7 +174,6 @@ class DruidDatasourceModelView(SupersetModelView, DeleteMixin): # noqa
'cluster': _("Cluster"),
'description': _("Description"),
'owner': _("Owner"),
'is_featured': _("Is Featured"),
'is_hidden': _("Is Hidden"),
'filter_select_enabled': _("Enable Filter Select"),
'default_endpoint': _("Default Endpoint"),
Expand Down
2 changes: 1 addition & 1 deletion superset/connectors/sqla/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ class SqlaTable(Model, BaseDatasource):
baselink = "tablemodelview"
export_fields = (
'table_name', 'main_dttm_col', 'description', 'default_endpoint',
'database_id', 'is_featured', 'offset', 'cache_timeout', 'schema',
'database_id', 'offset', 'cache_timeout', 'schema',
'sql', 'params')

__table_args__ = (
Expand Down
7 changes: 3 additions & 4 deletions superset/connectors/sqla/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,13 @@ def post_update(self, metric):
class TableModelView(SupersetModelView, DeleteMixin): # noqa
datamodel = SQLAInterface(models.SqlaTable)
list_columns = [
'link', 'database', 'is_featured',
'link', 'database',
'changed_by_', 'changed_on_']
order_columns = [
'link', 'database', 'is_featured', 'changed_on_']
'link', 'database', 'changed_on_']
add_columns = ['database', 'schema', 'table_name']
edit_columns = [
'table_name', 'sql', 'is_featured', 'filter_select_enabled',
'table_name', 'sql', 'filter_select_enabled',
'fetch_values_predicate', 'database', 'schema',
'description', 'owner',
'main_dttm_col', 'default_endpoint', 'offset', 'cache_timeout']
Expand Down Expand Up @@ -172,7 +172,6 @@ class TableModelView(SupersetModelView, DeleteMixin): # noqa
'changed_by_': _("Changed By"),
'database': _("Database"),
'changed_on_': _("Last Changed"),
'is_featured': _("Is Featured"),
'filter_select_enabled': _("Enable Filter Select"),
'schema': _("Schema"),
'default_endpoint': _("Default Endpoint"),
Expand Down
7 changes: 0 additions & 7 deletions superset/data/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ def load_energy():
if not tbl:
tbl = TBL(table_name=tbl_name)
tbl.description = "Energy consumption"
tbl.is_featured = True
tbl.database = get_or_create_main_db()
db.session.merge(tbl)
db.session.commit()
Expand Down Expand Up @@ -179,7 +178,6 @@ def load_world_bank_health_n_pop():
tbl = TBL(table_name=tbl_name)
tbl.description = utils.readfile(os.path.join(DATA_FOLDER, 'countries.md'))
tbl.main_dttm_col = 'year'
tbl.is_featured = True
tbl.database = get_or_create_main_db()
db.session.merge(tbl)
db.session.commit()
Expand Down Expand Up @@ -574,7 +572,6 @@ def load_birth_names():
obj = TBL(table_name='birth_names')
obj.main_dttm_col = 'ds'
obj.database = get_or_create_main_db()
obj.is_featured = True
db.session.merge(obj)
db.session.commit()
obj.fetch_metadata()
Expand Down Expand Up @@ -843,7 +840,6 @@ def load_unicode_test_data():
obj = TBL(table_name='unicode_test')
obj.main_dttm_col = 'date'
obj.database = get_or_create_main_db()
obj.is_featured = False
db.session.merge(obj)
db.session.commit()
obj.fetch_metadata()
Expand Down Expand Up @@ -922,7 +918,6 @@ def load_random_time_series_data():
obj = TBL(table_name='random_time_series')
obj.main_dttm_col = 'ds'
obj.database = get_or_create_main_db()
obj.is_featured = False
db.session.merge(obj)
db.session.commit()
obj.fetch_metadata()
Expand Down Expand Up @@ -988,7 +983,6 @@ def load_long_lat_data():
obj = TBL(table_name='long_lat')
obj.main_dttm_col = 'date'
obj.database = get_or_create_main_db()
obj.is_featured = False
db.session.merge(obj)
db.session.commit()
obj.fetch_metadata()
Expand Down Expand Up @@ -1050,7 +1044,6 @@ def load_multiformat_time_series_data():
obj = TBL(table_name='multiformat_time_series')
obj.main_dttm_col = 'ds'
obj.database = get_or_create_main_db()
obj.is_featured = False
dttm_and_expr_dict = {
'ds': [None, None],
'ds2': [None, None],
Expand Down

0 comments on commit abe79d1

Please sign in to comment.