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: ChartBuilderPlugin fixes for charts built from PPQs in Enterprise #2167

Merged
merged 9 commits into from
Sep 11, 2024

Conversation

mofojed
Copy link
Member

@mofojed mofojed commented Jul 22, 2024

  • Don't sanitize the descriptor in AppDashboards - the descriptor gets sanitized within the objectFetcher itself
    • By sanitizing too early, we lose metadata needed to load an object
  • ChartPanelPlugin uses the panelFetch to get the underlying object
    • In cases of a ParameterizedQuery on Enterprise, we only have the result of the ParameterizedQuery run in the ParameterizedQueryPanel
      • Aside, if we're looking at improving ParameterizedQuery support, we should complete DH-15760 (which would be breaking an internal API)
  • Use correct API when fetching a Chart object

- ChartPanelPlugin just uses the panelFetch to get the underlying object
- Don't sanitize in AppDashboards - the descriptor will get sanitized in the objectFetcher itself
- Should be opening up correctly now...
- Wasn't working for charts created from Parameterized Queries
@mofojed mofojed requested a review from mattrunyon July 22, 2024 19:38
@mofojed mofojed self-assigned this Jul 22, 2024
Copy link

codecov bot commented Jul 22, 2024

Codecov Report

Attention: Patch coverage is 30.00000% with 21 lines in your changes missing coverage. Please review.

Project coverage is 46.78%. Comparing base (d78ad6d) to head (cb49c8b).

Files with missing lines Patch % Lines
...es/dashboard-core-plugins/src/ChartPanelPlugin.tsx 0.00% 18 Missing ⚠️
...ackages/app-utils/src/components/AppDashboards.tsx 0.00% 1 Missing ⚠️
.../dashboard-core-plugins/src/ChartBuilderPlugin.tsx 0.00% 1 Missing ⚠️
...s/dashboard-core-plugins/src/panels/ChartPanel.tsx 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2167      +/-   ##
==========================================
+ Coverage   46.75%   46.78%   +0.02%     
==========================================
  Files         694      694              
  Lines       38639    38627      -12     
  Branches     9785     9659     -126     
==========================================
+ Hits        18065    18070       +5     
- Misses      20521    20546      +25     
+ Partials       53       11      -42     
Flag Coverage Δ
unit 46.78% <30.00%> (+0.02%) ⬆️

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
Collaborator

@mattrunyon mattrunyon left a comment

Choose a reason for hiding this comment

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

Is there a DHE ticket associated with this?

packages/dashboard-core-plugins/src/ChartPanelPlugin.tsx Outdated Show resolved Hide resolved
}

export const ChartPanelPlugin = forwardRef(
(props: WidgetPanelProps<DhType.plot.Figure>, ref: React.Ref<ChartPanel>) => {
const dh = useApi();
const fetchObject = useObjectFetcher();
const deferredApi = useContext(DeferredApiContext);
Copy link
Collaborator

Choose a reason for hiding this comment

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

This makes me wonder if we should still have useApi. Could useApi cause unknown bugs in DHE because we don't have the same complexity in DHC? I guess either way we would have to be cognizant of when to pass the metadata

Also, why not useDeferredApi(metadata) here?

- Use useDeferredApi instead of fetching from context directly
- Allow null to be passed in for descriptor in useDeferredApi and throw an error accordingly
- Don't return an error from makeModel until the API has loaded or an error has occurred
- Allow ChartPanel to reload if makeModel has updated even if it hasn't loaded a model yet
@mofojed mofojed merged commit 99b8d59 into deephaven:main Sep 11, 2024
11 checks passed
@mofojed mofojed deleted the fix-core-plugins-chart-builder branch September 11, 2024 13:59
@github-actions github-actions bot locked and limited conversation to collaborators Sep 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants