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 deck.gl form data #6953

Merged
merged 4 commits into from
Feb 27, 2019
Merged

Fix deck.gl form data #6953

merged 4 commits into from
Feb 27, 2019

Conversation

betodealmeida
Copy link
Member

Looks like we changed the schema of the form data payload, and this broke deck.gl visualizations. I fixed the visualizations, but it seems like there are other places where we still have the old format:

$ ggrep -ERsi '(formdata|fd|form_data)\.\w+_'
chart/chartAction.js:    const granularity = fd.time_grain_sqla || fd.granularity;
chart/chartAction.js:    fd.time_grain_sqla = granularity;
chart/chartAction.js:          has_extra_filters: formData.extra_filters && formData.extra_filters.length > 0,
chart/chartAction.js:          viz_type: formData.viz_type,
chart/chartAction.js:    const annotationLayers = formData.annotation_layers || [];
explore/store.js:  if (formData.y_axis_zero) {
explore/store.js:    formData.y_axis_bounds = [0, null];
explore/store.js:  const vizType = formData.viz_type || 'table';
explore/store.js:  const vizType = form_data.viz_type || 'table';
explore/exploreUtils.js:      viz_type: formData.viz_type,
explore/exploreUtils.js:  if (formData.slice_id) {
explore/exploreUtils.js:    search.form_data = safeStringify({ slice_id: formData.slice_id });
explore/components/ControlPanelsContainer.jsx:    return sectionsToRender(this.props.form_data.viz_type, this.props.datasource_type);
explore/components/ExploreChartHeader.jsx:              limit={formData.row_limit}
explore/components/ExploreViewContainer.jsx:    table_name: form_data.datasource_name,
explore/components/ExploreViewContainer.jsx:    vizType: form_data.viz_type,
explore/components/SaveModal.jsx:      vizType: props.form_data.viz_type,
dashboard/util/logging/childChartsDidLoad.js:    if (query.formData && query.formData.viz_type !== 'filter_box') {
dashboard/reducers/getInitialState.js:    if (['separator', 'markup'].indexOf(slice.form_data.viz_type) === -1) {
dashboard/reducers/getInitialState.js:        viz_type: slice.form_data.viz_type,
query/FormData.ts:  return 'granularity_sqla' in formData ? formData.granularity_sqla : formData.granularity;

@kristw should these be fixed as well? I'm not following the changes closely.

@codecov-io
Copy link

codecov-io commented Feb 27, 2019

Codecov Report

Merging #6953 into master will not change coverage.
The diff coverage is 0%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #6953   +/-   ##
=======================================
  Coverage   64.75%   64.75%           
=======================================
  Files         421      421           
  Lines       20377    20377           
  Branches     2249     2249           
=======================================
  Hits        13196    13196           
  Misses       7048     7048           
  Partials      133      133
Impacted Files Coverage Δ
...erset/assets/src/visualizations/deckgl/factory.jsx 0% <ø> (ø) ⬆️
superset/assets/src/visualizations/deckgl/utils.js 94.33% <ø> (ø) ⬆️
...ets/src/visualizations/deckgl/layers/Grid/Grid.jsx 0% <0%> (ø) ⬆️
...c/visualizations/deckgl/layers/Scatter/Scatter.jsx 0% <0%> (ø) ⬆️
...t/assets/src/visualizations/deckgl/Multi/Multi.jsx 0% <0%> (ø) ⬆️
...ets/src/visualizations/deckgl/layers/Path/Path.jsx 0% <0%> (ø) ⬆️
...ssets/src/visualizations/deckgl/layers/Hex/Hex.jsx 0% <0%> (ø) ⬆️
...sualizations/deckgl/CategoricalDeckGLContainer.jsx 0% <0%> (ø) ⬆️
...assets/src/visualizations/deckgl/layers/common.jsx 30.43% <0%> (ø) ⬆️
...c/visualizations/deckgl/layers/Polygon/Polygon.jsx 0% <0%> (ø) ⬆️
... and 3 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8f2ce75...2165c34. Read the comment docs.

@betodealmeida
Copy link
Member Author

Fixing the unit test, the last commit broke it.

@betodealmeida betodealmeida merged commit e0feec9 into apache:master Feb 27, 2019
xtinec pushed a commit that referenced this pull request Feb 27, 2019
* Fix deck.gl viz

* Fix more form data

* Fix a few more places

* Fix unit tests

(cherry picked from commit e0feec9)
@kristw
Copy link
Contributor

kristw commented Mar 1, 2019

formData created via the controls (and the one stored in states, as well as sent to back-end in JSON payload) has snake_case fields. It is transformed when passing to the charts and all fields become camelCase

The change in this PR looks good to me.

@betodealmeida
Copy link
Member Author

Thanks, @kristw! :)

xtinec added a commit to lyft/incubator-superset that referenced this pull request Apr 3, 2019
… snake_cased properties for deck vizzes.

This reverts commit e0feec9.
xtinec added a commit that referenced this pull request Apr 3, 2019
…bignumber.js change to SQL editor in an opt-in fashion (#7210)

* revert: bignumber patch to prevent rendering regression in charts

* Revert "Fix rendering regression from the introduction of bignumber (#6937)"

* fix: consume the bignumber.js reversion -- apply the bignumber conversion in `actions/sqlLab.js` where it is needed (aka opt into bignumber.js).

* Revert "Fix deck.gl form data (#6953)" b/c formData now returns snake_cased properties for deck vizzes.
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.34.0 labels Feb 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 !deprecated-label:bug Deprecated label - Use #bug instead v0.31 🚢 0.34.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants