diff --git a/superset-frontend/packages/superset-ui-core/src/utils/featureFlags.ts b/superset-frontend/packages/superset-ui-core/src/utils/featureFlags.ts
index 1492d83846e39..132d48c7a6767 100644
--- a/superset-frontend/packages/superset-ui-core/src/utils/featureFlags.ts
+++ b/superset-frontend/packages/superset-ui-core/src/utils/featureFlags.ts
@@ -38,6 +38,7 @@ export enum FeatureFlag {
DISABLE_LEGACY_DATASOURCE_EDITOR = 'DISABLE_LEGACY_DATASOURCE_EDITOR',
DISPLAY_MARKDOWN_HTML = 'DISPLAY_MARKDOWN_HTML',
DRILL_TO_DETAIL = 'DRILL_TO_DETAIL',
+ DRILL_BY = 'DRILL_BY',
DYNAMIC_PLUGINS = 'DYNAMIC_PLUGINS',
EMBEDDABLE_CHARTS = 'EMBEDDABLE_CHARTS',
EMBEDDED_SUPERSET = 'EMBEDDED_SUPERSET',
diff --git a/superset-frontend/src/SqlLab/components/SqlEditor/index.jsx b/superset-frontend/src/SqlLab/components/SqlEditor/index.jsx
index 2a93cad2706e9..c19db43089789 100644
--- a/superset-frontend/src/SqlLab/components/SqlEditor/index.jsx
+++ b/superset-frontend/src/SqlLab/components/SqlEditor/index.jsx
@@ -545,7 +545,7 @@ const SqlEditor = ({
/>
)}
- {scheduledQueriesConf && (
+ {!isEmpty(scheduledQueriesConf) && (
Model:
self.validate()
+ self._model = cast(Slice, self._model)
try:
Dashboard.clear_cache_for_slice(slice_id=self._model_id)
+ # Even though SQLAlchemy should in theory delete rows from the association
+ # table, sporadically Superset will error because the rows are not deleted.
+ # Let's do it manually here to prevent the error.
+ self._model.owners = []
chart = ChartDAO.delete(self._model)
except DAODeleteFailedError as ex:
logger.exception(ex.exception)
diff --git a/superset/config.py b/superset/config.py
index 4671e203c8c73..c9234e521d754 100644
--- a/superset/config.py
+++ b/superset/config.py
@@ -478,6 +478,7 @@ def _try_json_readsha(filepath: str, length: int) -> Optional[str]:
# Enable sharing charts with embedding
"EMBEDDABLE_CHARTS": True,
"DRILL_TO_DETAIL": False,
+ "DRILL_BY": False,
"DATAPANEL_CLOSED_BY_DEFAULT": False,
"HORIZONTAL_FILTER_BAR": False,
# The feature is off by default, and currently only supported in Presto and Postgres,
diff --git a/superset/datasets/commands/delete.py b/superset/datasets/commands/delete.py
index 6f91567958135..1487f1028b3be 100644
--- a/superset/datasets/commands/delete.py
+++ b/superset/datasets/commands/delete.py
@@ -15,7 +15,7 @@
# specific language governing permissions and limitations
# under the License.
import logging
-from typing import Optional
+from typing import cast, Optional
from flask_appbuilder.models.sqla import Model
from sqlalchemy.exc import SQLAlchemyError
@@ -43,7 +43,12 @@ def __init__(self, model_id: int):
def run(self) -> Model:
self.validate()
+ self._model = cast(SqlaTable, self._model)
try:
+ # Even though SQLAlchemy should in theory delete rows from the association
+ # table, sporadically Superset will error because the rows are not deleted.
+ # Let's do it manually here to prevent the error.
+ self._model.owners = []
dataset = DatasetDAO.delete(self._model, commit=False)
db.session.commit()
except (SQLAlchemyError, DAODeleteFailedError) as ex:
diff --git a/superset/tasks/thumbnails.py b/superset/tasks/thumbnails.py
index d76939a07e3a0..03b3999dce876 100644
--- a/superset/tasks/thumbnails.py
+++ b/superset/tasks/thumbnails.py
@@ -48,6 +48,9 @@ def cache_chart_thumbnail(
logger.warning("No cache set, refusing to compute")
return None
chart = cast(Slice, Slice.get(chart_id))
+ if not chart:
+ logger.warning("No chart found, skip computing chart thumbnail")
+ return None
url = get_url_path("Superset.slice", slice_id=chart.id)
logger.info("Caching chart: %s", url)
_, username = get_executor(