You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by jo...@apache.org on 2023/12/18 18:55:01 UTC
(superset) branch master updated: fix(typings): model_id is a multiple option (#25967)
This is an automated email from the ASF dual-hosted git repository.
johnbodley pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git
The following commit(s) were added to refs/heads/master by this push:
new 04f1c356a5 fix(typings): model_id is a multiple option (#25967)
04f1c356a5 is described below
commit 04f1c356a51464b49236c0dff379d71cd9a6cd4e
Author: Gnought <16...@users.noreply.github.com>
AuthorDate: Tue Dec 19 02:54:55 2023 +0800
fix(typings): model_id is a multiple option (#25967)
---
superset/cli/thumbnails.py | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/superset/cli/thumbnails.py b/superset/cli/thumbnails.py
index 325fab6853..0dd8edfb13 100755
--- a/superset/cli/thumbnails.py
+++ b/superset/cli/thumbnails.py
@@ -62,7 +62,7 @@ def compute_thumbnails(
dashboards_only: bool,
charts_only: bool,
force: bool,
- model_id: int,
+ model_id: list[int],
) -> None:
"""Compute thumbnails"""
# pylint: disable=import-outside-toplevel
@@ -76,12 +76,12 @@ def compute_thumbnails(
def compute_generic_thumbnail(
friendly_type: str,
model_cls: Union[type[Dashboard], type[Slice]],
- model_id: int,
+ model_ids: list[int],
compute_func: CallableTask,
) -> None:
query = db.session.query(model_cls)
- if model_id:
- query = query.filter(model_cls.id.in_(model_id))
+ if model_ids:
+ query = query.filter(model_cls.id.in_(model_ids))
dashboards = query.all()
count = len(dashboards)
for i, model in enumerate(dashboards):