fix: always allow tags to be returned via the API (#24060)

This commit is contained in:
Hugh A. Miles II
2023-05-22 14:09:12 -04:00
committed by GitHub
parent c3b96d12de
commit 7891cea7f7
3 changed files with 14 additions and 11 deletions

View File

@@ -143,9 +143,10 @@ class ChartRestApi(BaseSupersetModelRestApi):
"viz_type",
"query_context",
"is_managed_externally",
"tags.id",
"tags.name",
"tags.type",
]
if is_feature_enabled("TAGGING_SYSTEM"):
show_columns += ["tags.id", "tags.name", "tags.type"]
show_select_columns = show_columns + ["table.id"]
list_columns = [
@@ -192,9 +193,10 @@ class ChartRestApi(BaseSupersetModelRestApi):
"thumbnail_url",
"url",
"viz_type",
"tags.id",
"tags.name",
"tags.type",
]
if is_feature_enabled("TAGGING_SYSTEM"):
list_columns += ["tags.id", "tags.name", "tags.type"]
list_select_columns = list_columns + ["changed_by_fk", "changed_on"]
order_columns = [
"changed_by.first_name",
@@ -222,9 +224,8 @@ class ChartRestApi(BaseSupersetModelRestApi):
"dashboards",
"slice_name",
"viz_type",
"tags",
]
if is_feature_enabled("TAGGING_SYSTEM"):
search_columns += ["tags"]
base_order = ("changed_on", "desc")
base_filters = [["id", ChartFilter, lambda: []]]
search_filters = {
@@ -235,10 +236,8 @@ class ChartRestApi(BaseSupersetModelRestApi):
],
"slice_name": [ChartAllTextFilter],
"created_by": [ChartHasCreatedByFilter, ChartCreatedByMeFilter],
"tags": [ChartTagFilter],
}
if is_feature_enabled("TAGGING_SYSTEM"):
search_filters["tags"] = [ChartTagFilter]
# Will just affect _info endpoint
edit_columns = ["slice_name"]
add_columns = edit_columns