Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dashboard Screenshot API Endpooint Gives and Error Message when a Dashboard is Empty or has no Charts #30736

Closed
2 of 3 tasks
yousoph opened this issue Oct 29, 2024 · 2 comments · Fixed by #30767
Closed
2 of 3 tasks
Assignees
Labels
api:dashboard Related to the REST endpoints of the Dashboard dashboard:error Related to Dashboard errors preset:bounty:bug Bugs that have been selected by Preset and have a bounty attached. preset:bounty Issues that have been selected by Preset and have a bounty attached.

Comments

@yousoph
Copy link
Member

yousoph commented Oct 29, 2024

Bug description

When a dashboard is empty OR has only text elements, when the user tries to send an API call to generate a screenshot, they get an error message instead of a screenshot

Repro steps:

  1. Create a dashboard with just a title and save it OR create a dashboard with some text elements only and save it
  2. Find the dashboard ID of the dashboard
  3. Use the API to try to generate a screenshot for the dashboard

Use POST endpoint /api/v1/dashboard/{{DashboardID}}/cache_dashboard_screenshot/
By default, an empty array can be used as the request body to get the dashboard screenshot. Alternatively, it's possible to include below fields in the body:

  • dataMask (array): Specifies the dataMask configuration (controls applied filters).
    
  • activeTabs (list): Specify the tab(s) that should be included/selected.
    
  • urlParams (list): List of URL params to be applied to the dashboard.
    

The request returns an image_url value, that can be used to download the dashboard. It's also possible to append ?download_format=pdf to download a PDF as opposed to an image.

Expected results

A blank or text-only dashboard image/PDF will be generated.

Actual results

{"message":"Not found"} error was shown.

Screenshots/recordings

No response

Superset version

master / latest-dev

Python version

3.9

Node version

16

Browser

Chrome

Additional context

No response

Checklist

  • I have searched Superset docs and Slack and didn't find a solution to my problem.
  • I have searched the GitHub issue tracker and didn't find a similar bug report.
  • I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.
@yousoph yousoph added api:dashboard Related to the REST endpoints of the Dashboard preset:bounty Issues that have been selected by Preset and have a bounty attached. preset:bounty:bug Bugs that have been selected by Preset and have a bounty attached. labels Oct 29, 2024
@dosubot dosubot bot added the dashboard:error Related to Dashboard errors label Oct 29, 2024
@geido
Copy link
Member

geido commented Oct 30, 2024


🎉 Preset Bounty Available: $150 USD 🎉

To claim this bounty, please carefully follow the steps below.


📋 Steps to Participate

  1. Review Guidelines:
    Read through the Preset Bounty Program Contribution Guide for complete details on bounty requirements.

  2. Show Your Interest:
    Complete the Preset Bounty Program Survey and comment this issue to express your interest.

  3. Join the Slack Channel:
    After completing the survey, you’ll receive an invitation to the dedicated Apache Superset Slack channel.

  4. Get Assigned:
    To officially start, ensure a Bounty Program Manager has assigned you to this issue.

  5. Submit Your Solution:
    When ready, submit your solution with the Fixes #{issue_number} notation in your Pull Request description.

  6. Claim Your Bounty:
    Sign up at GitPay.me and submit your solution via: https://gitpay.me/#/task/968


💡 Additional Notes

  • Only developers assigned by a Bounty Program Manager should start working on this issue to win the bounty.
  • Be sure to follow the guide closely to avoid any delays in payment. Please, allow a few days after your PR has been merged for the bounty to be released.

Good luck, and happy coding! 🎉

@msyavuz
Copy link
Contributor

msyavuz commented Oct 30, 2024

Hey @geido, can i work on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api:dashboard Related to the REST endpoints of the Dashboard dashboard:error Related to Dashboard errors preset:bounty:bug Bugs that have been selected by Preset and have a bounty attached. preset:bounty Issues that have been selected by Preset and have a bounty attached.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants
@yousoph @geido @msyavuz and others