bito-code-review[bot] commented on code in PR #38576:
URL: https://github.com/apache/superset/pull/38576#discussion_r3476968789
##########
superset/tasks/thumbnails.py:
##########
@@ -90,6 +93,9 @@ def cache_dashboard_thumbnail(
dashboard = Dashboard.get(dashboard_id)
url = get_url_path("Superset.dashboard", dashboard_id_or_slug=dashboard.id)
+ screenshot = DashboardScreenshot(url, dashboard.digest)
+ resolved_cache_key = cache_key or screenshot.get_cache_key(window_size,
thumb_size)
Review Comment:
<!-- Bito Reply -->
The suggestion to remove the `resolved_cache_key` variable is appropriate.
As noted in the review, the variable is assigned but never used, and the
`compute_and_cache` method handles the cache key resolution internally, making
the line redundant.
**superset/tasks/thumbnails.py**
```
screenshot = DashboardScreenshot(url, dashboard.digest)
logger.info("Caching dashboard: %s", url)
_, username = get_executor(
```
##########
superset/dashboards/api.py:
##########
@@ -1471,7 +1471,6 @@ def build_response(status_code: int) -> WerkzeugResponse:
if cache_payload.should_trigger_task(force):
logger.info("Triggering screenshot ASYNC")
- screenshot_obj.cache.set(cache_key,
ScreenshotCachePayload().to_dict())
cache_dashboard_screenshot.delay(
Review Comment:
<!-- Bito Reply -->
The decision to remove the redundant cache write is appropriate given that
the task-level distributed lock handles deduplication. Since the API-level
write was not strictly necessary for status tracking, its removal simplifies
the code without introducing functional regressions. Aligning the pattern with
other modules can be handled as a separate cleanup task as you suggested.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]