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

fix(viz-gallery): respect denylist in viz gallery #22658

Merged
merged 6 commits into from
Jan 10, 2023

Conversation

villebro
Copy link
Member

@villebro villebro commented Jan 10, 2023

SUMMARY

The config parameter VIZ_TYPE_DENYLIST should make it possible to omit certain viz plugins:

superset/superset/config.py

Lines 777 to 783 in 159dcd7

# ---------------------------------------------------
# List of viz_types not allowed in your environment
# For example: Disable pivot table and treemap:
# VIZ_TYPE_DENYLIST = ['pivot_table', 'treemap']
# ---------------------------------------------------
VIZ_TYPE_DENYLIST: List[str] = []

However, currently the viz gallery displays all chart types from MainPresets.js despite adding specific charts to the denylist.

To test, add the following to your `superset_config.py:

VIZ_TYPE_DENYLIST = ["big_number", "big_number_total", "pie"]

AFTER

With the changes, the big number and pie charts are all removed:
image

BEFORE

Currently they are all displayed:
image

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

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

@codecov
Copy link

codecov bot commented Jan 10, 2023

Codecov Report

Merging #22658 (aff60f1) into master (399f6e3) will decrease coverage by 0.76%.
The diff coverage is 47.36%.

❗ Current head aff60f1 differs from pull request most recent head 33a7390. Consider uploading reports for the commit 33a7390 to get more accurate results

@@            Coverage Diff             @@
##           master   #22658      +/-   ##
==========================================
- Coverage   66.35%   65.59%   -0.77%     
==========================================
  Files        1869     1869              
  Lines       71582    71582              
  Branches     7814     7814              
==========================================
- Hits        47497    46952     -545     
- Misses      22044    22589     +545     
  Partials     2041     2041              
Flag Coverage Δ
hive ?
postgres 78.08% <ø> (?)
presto ?
python 78.15% <ø> (-1.59%) ⬇️
sqlite 76.48% <ø> (ø)
unit ?

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

Impacted Files Coverage Δ
superset-frontend/src/SqlLab/App.jsx 0.00% <0.00%> (ø)
...et-frontend/src/dashboard/components/Dashboard.jsx 64.77% <0.00%> (ø)
superset-frontend/src/embedded/api.tsx 0.00% <ø> (ø)
superset-frontend/src/embedded/index.tsx 0.00% <ø> (ø)
...ponents/controls/VizTypeControl/VizTypeGallery.tsx 88.17% <ø> (ø)
superset-frontend/src/profile/App.tsx 0.00% <0.00%> (ø)
superset-frontend/src/profile/components/App.tsx 50.00% <ø> (ø)
...frontend/src/profile/components/CreatedContent.tsx 81.81% <ø> (ø)
...rset-frontend/src/profile/components/Favorites.tsx 77.77% <ø> (ø)
...frontend/src/profile/components/RecentActivity.tsx 50.00% <ø> (ø)
... and 141 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@pull-request-size pull-request-size bot added size/L and removed size/S labels Jan 10, 2023
@villebro villebro force-pushed the villebro/fix-viz-denylist branch 2 times, most recently from 95a464d to 13649fc Compare January 10, 2023 10:19
config = bootstrapData?.common?.conf;
} else {
config = {};
logging.warn('asyncEvent: app config data not found');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to remove that log?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, the weird thing is, I don't really see any situation where we would ever hit a page that doesn't have bootstrap data on it. This is related to GAQ, and GAQ is definitely always called from some place where there's bootstrap data. So I think it should be safe to remove (incidentally, I'll probably be working on GAQ soon, so I can address this later if it's really needed).

Copy link
Member

@kgabryje kgabryje left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 tiny nit, LGTM

@villebro villebro merged commit 08f45ef into apache:master Jan 10, 2023
@villebro villebro deleted the villebro/fix-viz-denylist branch January 16, 2023 12:48
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 2.1.0 and removed 🚢 2.1.3 labels Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/L 🚢 2.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants