Comments (4)
To resolve the issue in Apache Superset version 3.1.3 where long dashboards render blank thumbnails, you can modify the DashboardCard
component to handle the thumbnail fetching more effectively. Specifically, ensure that the thumbnail URL is set correctly and that the fetching process is managed properly.
Here is the relevant part of the DashboardCard
component that deals with fetching and setting the thumbnail URL:
useEffect(() => {
// fetch thumbnail only if it's not already fetched
if (
!fetchingThumbnail &&
dashboard.id &&
(thumbnailUrl === undefined || thumbnailUrl === null) &&
isFeatureEnabled(FeatureFlag.Thumbnails)
) {
// fetch thumbnail
if (dashboard.thumbnail_url) {
// set to empty string if null so that we don't
// keep fetching the thumbnail
setThumbnailUrl(dashboard.thumbnail_url || '');
return;
}
setFetchingThumbnail(true);
SupersetClient.get({
endpoint: `/api/v1/dashboard/${dashboard.id}`,
}).then(({ json = {} }) => {
setThumbnailUrl(json.thumbnail_url || '');
setFetchingThumbnail(false);
});
}
}, [dashboard, thumbnailUrl]);
Ensure that the thumbnailUrl
is set to an empty string if the dashboard.thumbnail_url
is null. This prevents repeated fetching attempts which might be causing the issue with long dashboards [1].
Additionally, make sure that the cover
property in the ListViewCard
component is correctly set to handle the absence of thumbnails:
cover={
!isFeatureEnabled(FeatureFlag.Thumbnails) || !showThumbnails ? (
<></>
) : null
}
This ensures that the component does not attempt to render a thumbnail if the feature is disabled or if thumbnails are not to be shown [1].
By making these adjustments, you should be able to resolve the issue with blank thumbnails for long dashboards.
To continue talking to Dosu, mention @dosu.
from superset.
To address the issue where long dashboards render blank thumbnails in Apache Superset version 3.1.3, you can try the following steps:
-
Ensure Playwright is Properly Installed and Configured:
Make sure theplaywright
package and its dependencies are correctly installed and configured in your Dockerfile:FROM apache/superset:3.1.3 RUN pip install --no-cache-dir \ playwright \ && playwright install-deps \ && playwright install
-
Adjust Playwright Settings:
Increase theSCREENSHOT_PLAYWRIGHT_DEFAULT_TIMEOUT
to allow more time for rendering:SCREENSHOT_PLAYWRIGHT_DEFAULT_TIMEOUT = int(timedelta(seconds=120).total_seconds() * 1000)
-
Simplify the Dashboard:
Consider simplifying the dashboard by reducing the number of elements or using tabs to avoid rendering issues with long dashboards. This can help Playwright handle the rendering more effectively. -
Modify the
DashboardCard
Component:
Ensure theDashboardCard
component correctly handles the fetching and setting of the thumbnail URL:useEffect(() => { if ( !fetchingThumbnail && dashboard.id && (thumbnailUrl === undefined || thumbnailUrl === null) && isFeatureEnabled(FeatureFlag.Thumbnails) ) { if (dashboard.thumbnail_url) { setThumbnailUrl(dashboard.thumbnail_url || ''); return; } setFetchingThumbnail(true); SupersetClient.get({ endpoint: `/api/v1/dashboard/${dashboard.id}`, }).then(({ json = {} }) => { setThumbnailUrl(json.thumbnail_url || ''); setFetchingThumbnail(false); }); } }, [dashboard, thumbnailUrl]);
-
Ensure Feature Flags are Enabled:
Verify that theTHUMBNAILS
andPLAYWRIGHT_REPORTS_AND_THUMBNAILS
feature flags are enabled in yoursuperset/config.py
file:DEFAULT_FEATURE_FLAGS: dict[str, bool] = { ... "THUMBNAILS": True, "PLAYWRIGHT_REPORTS_AND_THUMBNAILS": True, ... }
By following these steps, you should be able to resolve the issue with blank thumbnails for long dashboards [1][2].
To continue talking to Dosu, mention @dosu.
from superset.
@dosu
It's not that dashboard.thumbnail_url is null
, it's that the thumbnail does not have any charts when it is created unless the height of the dashboard is lower than a certain value
from superset.
Related Issues (20)
- Failed to setup alerts and reports based pypi installation HOT 6
- 4.0.1: Alerting and reports does not take EMAIL RECIPIENTS* HOT 4
- Filter does not follow label HOT 1
- [SIP-138] Proposal for Slack file upload V2 integration for Alerts and Reports HOT 3
- [SIP-139] Proposal for Ant Design 5.x Upgrade HOT 4
- On KILL QUERY error "expected string or bytes-like object" in Clickhouse DB HOT 1
- build fails when using docker compose up HOT 7
- Blank Charts while loading dashboard HOT 2
- Warning when upgrading DB HOT 1
- 500 error and unexpected keyword argument 'extra_filters' HOT 3
- sqlalchemy.exc.ArgumentError HOT 1
- Oracle as Metadata- Not working HOT 2
- Thumbnails work for Dashboards, not for charts HOT 1
- Unable to set role permissions for new schema unless a new connection is created. HOT 1
- Superset Login Redirect After Guest Token Usage in Angular Iframe HOT 1
- start of production no possible due to errors in docker-compose-non-dev.yml and docker/.env HOT 3
- Data Misalignment When Applying Filter HOT 5
- PLAYWRIGHT_REPORTS_AND_THUMBNAILS grey output for dashboards HOT 4
- Changing to non-temporal variable, then back, causes time grain to no longer function in 4.0.2rc2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from superset.