You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by mi...@apache.org on 2023/12/27 12:31:19 UTC

(superset) 01/14: fix(typings): model_id is a multiple option (#25967)

This is an automated email from the ASF dual-hosted git repository.

michaelsmolina pushed a commit to branch 3.1
in repository https://gitbox.apache.org/repos/asf/superset.git

commit dd68c6e2e567ed1c2f8c7697629fb60bd55f0abc
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)
    
    (cherry picked from commit 04f1c356a51464b49236c0dff379d71cd9a6cd4e)
---
 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):