apache / superset

Apache Superset is a Data Visualization and Data Exploration Platform
https://superset.apache.org/
Apache License 2.0
60.77k stars 13.15k forks source link

PLAYWRIGHT_REPORTS_AND_THUMBNAILS grey output for dashboards #29324

Open kevinremoue opened 4 weeks ago

kevinremoue commented 4 weeks ago

Bug description

I have the following flags on superset 3.1.x

FEATURE_FLAGS = {
    "DASHBOARD_RBAC": True,
    "ENABLE_TEMPLATE_PROCESSING": True,
    "GLOBAL_ASYNC_QUERIES": True,
    "HORIZONTAL_FILTER_BAR": True,
    "DRILL_BY": True,
    "DRILL_TO_DETAIL": True,
    "ALERT_REPORTS": True,
    "PLAYWRIGHT_REPORTS_AND_THUMBNAILS": True
    }

Using Selenium I had issue with map GL components so I activated the playwright flag.

Since I have activated playwright I am able to render single chart only in reports. If I trigger reports on whole dashboard I got the following output: image

No logs for playwright as the report is considered successful.

How to reproduce the bug

  1. Setup playwright integration
  2. Go to reports
  3. Create a report with a dashboard by email
  4. Check email content

Screenshots/recordings

No response

Superset version

3.1.3

Python version

3.9

Node version

16

Browser

Chrome

Additional context

No response

Checklist

dosubot[bot] commented 4 weeks ago

Hello @kevinremoue! I'm here to help you with your Superset issue. I can assist with bug solving, answer questions, and guide you on becoming a contributor. Let's work on resolving your concern together while we wait for a human maintainer.

Enabling the PLAYWRIGHT_REPORTS_AND_THUMBNAILS feature in Apache Superset version 3.1.3 results in blank chart areas with a placeholder link when generating reports for an entire dashboard because the feature requires the installation of the "playwright" pip package. Additionally, a headless browser must be installed and properly configured. If these components are not installed or configured correctly, the feature will not function properly, leading to issues such as blank chart areas.

Moreover, the WebDriverPlaywright class in the superset/utils/webdriver.py file indicates that the Playwright integration involves several steps, including authenticating the browser context, waiting for elements to load, and handling potential errors. If any of these steps fail, it could result in blank chart areas. Specifically, the code waits for chart containers to draw and for loading elements to disappear. If these elements do not load correctly, the screenshot will not capture the charts, leading to blank areas [1][2][3][4].

To continue talking to Dosu, mention @dosu.

rajivpatki commented 4 weeks ago

I was just about to post this.

For me the output is blank unless I remove some elements from view in the dashboard. ie: if the dashboard is too long, it will generate a blank thumbnail, but if I put in a 2 tabs and hide an entire 2 rows of chart inside the second tab, the thumbnail is rendered properly.

I'm using playwright

rusackas commented 4 weeks ago

Seems like a duplicate of https://github.com/apache/superset/issues/29326. We should probably close one of these in favor of the other.

rajivpatki commented 4 weeks ago

Seems like a duplicate of https://github.com/apache/superset/issues/29326. We should probably close one of these in favor of the other.

I wasn't sure if they were duplicates. I do face a similar issue with Slack Reports for long dashboards but some which don't render the Thumbnail manage to render the Report without issues. So I thought the problem might be different for these two issues