fix(reports): downgrade chart-container timeout log level and fix tiling veto on unknown height - #42153
Conversation
Code Review Agent Run #6b7e95Actionable Suggestions - 0Filtered by Review RulesBito filtered these suggestions based on rules created automatically for your feedback. Manage rules.
Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #42153 +/- ##
==========================================
- Coverage 65.44% 65.44% -0.01%
==========================================
Files 2810 2810
Lines 159362 159371 +9
Branches 36372 36372
==========================================
+ Hits 104292 104294 +2
- Misses 53027 53034 +7
Partials 2043 2043
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…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>
0f752c9 to
a1cb930
Compare
|
Rebased onto current master (clean cherry-pick, no conflicts) and ran an adversarial self-review against the newly merged readiness work before requesting human review. Verdict: no blockers. The scope checks requested for this PR, with evidence: Production-safe selectors — confirmed. The diff introduces no Unknown-height/tiling behavior — still useful, and safer than it looks. By the time the tiling decision runs, Compatibility with #42624's tiling guard — preserved. For known heights, Two review nits applied in the amended commit:
One pre-existing inconsistency noted for a follow-up (not this PR):
|
| slice_container_elem.wait_for() | ||
| rendered_chart_count += 1 |
There was a problem hiding this comment.
Suggestion: Locator.wait_for() only waits for the locator's default presence/visibility condition; it does not establish that a chart has rendered or reached a terminal state. The counter is therefore incremented for containers that may still contain a spinner or no chart content, and the timeout log can falsely report them as rendered. Use the actual chart readiness predicate for the progress count, or describe the count as containers located rather than rendered. [comment mismatch]
Severity Level: Minor 🧹
- ⚠️ Timeout logs can overstate rendered chart progress.
- ⚠️ Report diagnostics may mislead operators during slow loads.
- ✅ Standard and tiled readiness gates remain unaffected.(Use Cmd/Ctrl + Click for best experience)
Prompt for AI Agent 🤖
This is a comment left during a code review.
**Path:** superset/utils/webdriver.py
**Line:** 496:497
**Comment:**
*Comment Mismatch: `Locator.wait_for()` only waits for the locator's default presence/visibility condition; it does not establish that a chart has rendered or reached a terminal state. The counter is therefore incremented for containers that may still contain a spinner or no chart content, and the timeout log can falsely report them as rendered. Use the actual chart readiness predicate for the progress count, or describe the count as containers located rather than rendered.
Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix|
The flagged issue is correct. To resolve this, you should either rename the variable to reflect that it counts located containers, or implement a more robust readiness check (e.g., waiting for a specific class or state that indicates the chart has finished rendering). Given the current implementation, renaming the variable is the most straightforward fix. Would you like me to fetch all other comments on this PR to validate and implement fixes for them as well? superset/utils/webdriver.py |
Code Review Agent Run #a82407Actionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
Summary
WebDriverPlaywright.get_screenshot()waits for.chart-containerelements to render before deciding whether to use tiled or standard screenshot capture for a dashboard. Two issues in that logic:ERROR(logger.exception), inconsistent with theWARNINGlevel already used for the sibling spinner-wait timeouts a few lines below in the same method.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
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.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 atWARNINGwhen it's actually consequential (i.e. the dashboard looks large by chart count but tiling would otherwise have been skipped); it'sDEBUGfor the common, benign case of a small dashboard with an unmeasured height.Not changed
Testing
Added to
tests/unit_tests/utils/webdriver_test.py:WARNINGwith rendered/total progress and still raises (never logs vialogger.exception).DEBUG, notWARNING, for the small-dashboard case where that's the expected/benign path.Full relevant test suite passing;
ruff check,ruff format, andmypyclean on both changed files.Additional information