Skip to content

fix(reports): downgrade chart-container timeout log level and fix tiling veto on unknown height#42153

Open
eschutho wants to merge 1 commit into
masterfrom
fix-chart-container-locate-wait-timeout
Open

fix(reports): downgrade chart-container timeout log level and fix tiling veto on unknown height#42153
eschutho wants to merge 1 commit into
masterfrom
fix-chart-container-locate-wait-timeout

Conversation

@eschutho

Copy link
Copy Markdown
Member

Summary

WebDriverPlaywright.get_screenshot() waits for .chart-container elements to render before deciding whether to use tiled or standard screenshot capture for a dashboard. Two issues in that logic:

  1. A timeout while waiting for chart containers to render was logged at ERROR (logger.exception), inconsistent with the WARNING level already used for the sibling spinner-wait timeouts a few lines below in the same method.
  2. When the DOM query used to measure the dashboard's height returns 0 (the query found no matching element, or the layout hadn't settled yet), the code treated that the same as "the dashboard is small enough for a single tile" — which could veto tiled capture even when the chart count alone indicated a large dashboard. That could let a large, virtualized dashboard skip the scroll-driven tiling pass and ship with below-the-fold charts that never rendered.

Fix

  • The chart-container timeout now logs at WARNING, matching the convention already used for the other Playwright locate-wait timeouts in this method (customer-side chart loading is usually just slow, not a Superset bug). The screenshot still fails — the exception is still re-raised — only the log level and message changed; the message now also reports how many chart containers rendered before the timeout, for easier debugging.
  • An unmeasurable height (0) is now treated as "unknown" rather than "small". Whether tiling is attempted is decided by the chart-count signal alone when height can't be measured, instead of chart count being silently overridden. The corresponding log line is only emitted at WARNING when it's actually consequential (i.e. the dashboard looks large by chart count but tiling would otherwise have been skipped); it's DEBUG for the common, benign case of a small dashboard with an unmeasured height.

Not changed

  • The tiled-capture path itself (per-tile readiness, wait budgeting, etc.) — this PR only touches the earlier decision of whether to tile and the log level of one existing timeout.
  • Standard (non-tiled) capture behavior for dashboards that were already correctly identified as small.

Testing

Added to tests/unit_tests/utils/webdriver_test.py:

  • A large dashboard (by chart count) whose height can't be measured still attempts tiled capture instead of being silently downgraded to standard capture.
  • The chart-container timeout logs at WARNING with rendered/total progress and still raises (never logs via logger.exception).
  • Updated the existing "unknown height falls back" test to assert DEBUG, not WARNING, for the small-dashboard case where that's the expected/benign path.

Full relevant test suite passing; ruff check, ruff format, and mypy clean on both changed files.

Additional information

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

…ing veto on unknown height

The chart-container locate-wait timeout was logged via logger.exception
(ERROR + traceback), inconsistent with the WARNING level already used for
the sibling spinner-wait timeouts in the same method. Bring it in line and
add rendered/total chart-container progress to the message; the timeout
still re-raises, so report generation already failed loudly here.

Also fix a real bug in the tiled-screenshot heuristic: when the DOM query
for a dashboard's height comes back empty (returns 0), the code treated
that as "small enough for a single tile", vetoing tiling even when
chart_count alone showed the dashboard was large. That could let a large
dashboard skip the scroll-driven tiling pass and ship with below-the-fold
charts that never rendered. An unknown height no longer overrides a
chart_count-based large-dashboard signal, and the warning is now only
logged when it's actually consequential (downgraded to debug otherwise).

Co-Authored-By: Claude <noreply@anthropic.com>
@bito-code-review

bito-code-review Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Code Review Agent Run #6b7e95

Actionable Suggestions - 0
Filtered by Review Rules

Bito filtered these suggestions based on rules created automatically for your feedback. Manage rules.

  • superset/utils/webdriver.py - 1
Review Details
  • Files reviewed - 2 · Commit Range: 0f752c9..0f752c9
    • superset/utils/webdriver.py
    • tests/unit_tests/utils/webdriver_test.py
  • Files skipped - 0
  • Tools
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@dosubot dosubot Bot added the alert-reports Namespace | Anything related to the Alert & Reports feature label Jul 18, 2026
@codecov

codecov Bot commented Jul 18, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 65.06%. Comparing base (9f230bc) to head (0f752c9).
⚠️ Report is 21 commits behind head on master.

Files with missing lines Patch % Lines
superset/utils/webdriver.py 0.00% 12 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #42153      +/-   ##
==========================================
- Coverage   65.17%   65.06%   -0.12%     
==========================================
  Files        2753     2758       +5     
  Lines      154657   155205     +548     
  Branches    35484    35560      +76     
==========================================
+ Hits       100801   100982     +181     
- Misses      51940    52308     +368     
+ Partials     1916     1915       -1     
Flag Coverage Δ
hive 38.94% <0.00%> (-0.05%) ⬇️
mysql 57.62% <0.00%> (-0.18%) ⬇️
postgres 57.68% <0.00%> (-0.18%) ⬇️
presto 40.89% <0.00%> (-0.06%) ⬇️
python 59.10% <0.00%> (-0.19%) ⬇️
sqlite 57.29% <0.00%> (-0.18%) ⬇️
unit 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

alert-reports Namespace | Anything related to the Alert & Reports feature size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant