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

perf(explore): virtualized datasource field sections #27625

Merged

Conversation

justinpark
Copy link
Member

SUMMARY

At Airbnb, we have a dataset that contains > 10k columns and metrics.
Given the size of this dataset, the current rendering of the show all datasource target list is not realistic.

To address this issue, this commit introduces virtualized rendering for the field sections, which significantly improves performance and supports handling large-sized metadata datasets.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before:

before--virtualized-list.mov

After:

after--virtualized-list.mov

TESTING INSTRUCTIONS

Go to "create a chart" and then

  • test drag and drop
  • test show/hide all
  • test collapse/expand header

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

Copy link

codecov bot commented Mar 22, 2024

Codecov Report

Attention: Patch coverage is 77.77778% with 12 lines in your changes are missing coverage. Please review.

Project coverage is 67.50%. Comparing base (f274c47) to head (5458cfa).
Report is 37 commits behind head on master.

Files Patch % Lines
...components/DatasourcePanel/DatasourcePanelItem.tsx 87.50% 3 Missing and 2 partials ⚠️
...d/src/explore/components/DatasourcePanel/index.tsx 50.00% 0 Missing and 4 partials ⚠️
.../explore/components/ExploreViewContainer/index.jsx 50.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #27625      +/-   ##
==========================================
+ Coverage   67.46%   67.50%   +0.03%     
==========================================
  Files        1910     1911       +1     
  Lines       74802    74840      +38     
  Branches     8345     8374      +29     
==========================================
+ Hits        50467    50517      +50     
+ Misses      22284    22270      -14     
- Partials     2051     2053       +2     
Flag Coverage Δ
javascript 57.46% <77.77%> (+0.07%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@michael-s-molina michael-s-molina left a comment

Choose a reason for hiding this comment

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

Thank you for the improvement @justinpark!

totalColumns: number;
width: number;
showAllMetrics: boolean;
setShowAllMetrics: (showAll: boolean) => void;
Copy link
Member

Choose a reason for hiding this comment

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

I think from the component's viewpoint setShowAllMetrics should be named showAllMetricsChanged or onShowAllMetrics. I know that the parent component will set a state with this value but the component's API shouldn't reflect that. This component can be used elsewhere and the event can be handled differently.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done!

`}
`;

const DatasourcePanelItem: React.FC<Props> = ({ index, style, data }) => {
Copy link
Member

Choose a reason for hiding this comment

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

Nice work extracting the component into its own file and adding tests 👏🏼

@michael-s-molina
Copy link
Member

/testenv up

Copy link
Contributor

@michael-s-molina Ephemeral environment spinning up at http://34.221.95.247:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

Copy link
Member

@michael-s-molina michael-s-molina left a comment

Choose a reason for hiding this comment

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

LGTM. I left a non-blocking comment about nomenclature.

@justinpark justinpark merged commit 38eecfc into apache:master Mar 27, 2024
30 checks passed
Copy link
Contributor

Ephemeral environment shutdown and build artifacts deleted.

@michael-s-molina michael-s-molina added the v4.0 Label added by the release manager to track PRs to be included in the 4.0 branch label Mar 28, 2024
michael-s-molina pushed a commit that referenced this pull request Mar 28, 2024
EandrewJones pushed a commit to UMD-ARLIS/superset that referenced this pull request Apr 5, 2024
EnxDev pushed a commit to EnxDev/superset that referenced this pull request Apr 12, 2024
@mistercrunch mistercrunch added 🍒 4.0.0 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels labels Apr 17, 2024
qleroy pushed a commit to qleroy/superset that referenced this pull request Apr 28, 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 dependencies:npm size/XL v4.0 Label added by the release manager to track PRs to be included in the 4.0 branch 🍒 4.0.0 🍒 4.0.1 🍒 4.0.2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants