Skip to content

Commit

Permalink
remove from api
Browse files Browse the repository at this point in the history
  • Loading branch information
hughhhh committed Apr 4, 2023
1 parent 1a1ee73 commit 4017244
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 39 deletions.
13 changes: 5 additions & 8 deletions superset/charts/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ def ensure_thumbnails_enabled(self) -> Optional[Response]:
"query_context",
"is_managed_externally",
]
if is_feature_enabled("TAGGING_SYSTEM"):
show_columns += ["tags.id", "tags.name", "tags.type"]

show_columns += ["tags.id", "tags.name", "tags.type"]

show_select_columns = show_columns + ["table.id"]
list_columns = [
Expand Down Expand Up @@ -195,8 +195,7 @@ def ensure_thumbnails_enabled(self) -> Optional[Response]:
"url",
"viz_type",
]
if is_feature_enabled("TAGGING_SYSTEM"):
list_columns += ["tags.id", "tags.name", "tags.type"]
list_columns += ["tags.id", "tags.name", "tags.type"]
list_select_columns = list_columns + ["changed_by_fk", "changed_on"]
order_columns = [
"changed_by.first_name",
Expand Down Expand Up @@ -225,8 +224,7 @@ def ensure_thumbnails_enabled(self) -> Optional[Response]:
"slice_name",
"viz_type",
]
if is_feature_enabled("TAGGING_SYSTEM"):
search_columns += ["tags"]
search_columns += ["tags"]
base_order = ("changed_on", "desc")
base_filters = [["id", ChartFilter, lambda: []]]
search_filters = {
Expand All @@ -238,8 +236,7 @@ def ensure_thumbnails_enabled(self) -> Optional[Response]:
"slice_name": [ChartAllTextFilter],
"created_by": [ChartHasCreatedByFilter, ChartCreatedByMeFilter],
}
if is_feature_enabled("TAGGING_SYSTEM"):
search_filters["tags"] = [ChartTagFilter]
search_filters["tags"] = [ChartTagFilter]

# Will just affect _info endpoint
edit_columns = ["slice_name"]
Expand Down
34 changes: 10 additions & 24 deletions superset/dashboards/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,7 @@ def ensure_thumbnails_enabled(self) -> Optional[Response]:
"roles.name",
"is_managed_externally",
]
if is_feature_enabled("TAGGING_SYSTEM"):
list_columns += ["tags.id", "tags.name", "tags.type"]
list_columns += ["tags.id", "tags.name", "tags.type"]
list_select_columns = list_columns + ["changed_on", "created_on", "changed_by_fk"]
order_columns = [
"changed_by.first_name",
Expand All @@ -217,28 +216,15 @@ def ensure_thumbnails_enabled(self) -> Optional[Response]:
edit_columns = add_columns

search_columns = (
(
"created_by",
"changed_by",
"dashboard_title",
"id",
"owners",
"published",
"roles",
"slug",
"tags",
)
if is_feature_enabled("TAGGING_SYSTEM")
else (
"created_by",
"changed_by",
"dashboard_title",
"id",
"owners",
"published",
"roles",
"slug",
)
"created_by",
"changed_by",
"dashboard_title",
"id",
"owners",
"published",
"roles",
"slug",
"tags",
)
search_filters = {
"dashboard_title": [DashboardTitleOrSlugFilter],
Expand Down
11 changes: 4 additions & 7 deletions superset/queries/saved_queries/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
from flask_appbuilder.models.sqla.interface import SQLAInterface
from flask_babel import ngettext

from superset import is_feature_enabled
from superset.commands.importers.exceptions import (
IncorrectFormatError,
NoValidFilesFoundError,
Expand Down Expand Up @@ -119,8 +118,7 @@ class SavedQueryRestApi(BaseSupersetModelRestApi):
"sql",
"sql_tables",
]
if is_feature_enabled("TAGGING_SYSTEM"):
list_columns += ["tags.id", "tags.name", "tags.type"]
list_columns += ["tags.id", "tags.name", "tags.type"]
list_select_columns = list_columns + ["changed_by_fk", "changed_on"]
add_columns = [
"db_id",
Expand All @@ -145,14 +143,13 @@ class SavedQueryRestApi(BaseSupersetModelRestApi):
]

search_columns = ["id", "database", "label", "schema", "created_by"]
if is_feature_enabled("TAGGING_SYSTEM"):
search_columns += ["tags"]
search_columns += ["tags"]
search_filters = {
"id": [SavedQueryFavoriteFilter],
"label": [SavedQueryAllTextFilter],
}
if is_feature_enabled("TAGGING_SYSTEM"):
search_filters["tags"] = [SavedQueryTagFilter]

search_filters["tags"] = [SavedQueryTagFilter]

apispec_parameter_schemas = {
"get_delete_ids_schema": get_delete_ids_schema,
Expand Down

0 comments on commit 4017244

Please sign in to comment.