Skip to content

Commit

Permalink
fix(typings): model_id is a multiple option (apache#25967)
Browse files Browse the repository at this point in the history
(cherry picked from commit 04f1c35)
  • Loading branch information
gnought authored and josedev-union committed Jan 22, 2024
1 parent 4d75919 commit 4407706
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions superset/cli/thumbnails.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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):
Expand Down

0 comments on commit 4407706

Please sign in to comment.