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(native-filters): merge_extra_form_data extras processing #14244

Merged
merged 2 commits into from Apr 20, 2021

Conversation

villebro
Copy link
Member

SUMMARY

The utility function that merges extra_form_data into the main form_data processed extras incorrectly. This fixes the error and adds a test that would have caught it.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TEST PLAN

CI + new tests

ADDITIONAL INFORMATION

  • Has associated issue:
  • 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 Apr 20, 2021

Codecov Report

Merging #14244 (6119d8e) into master (9d67b46) will decrease coverage by 0.22%.
The diff coverage is 77.27%.

❗ Current head 6119d8e differs from pull request most recent head 354014b. Consider uploading reports for the commit 354014b to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master   #14244      +/-   ##
==========================================
- Coverage   76.11%   75.89%   -0.23%     
==========================================
  Files         945      945              
  Lines       47947    47947              
  Branches     5950     5950              
==========================================
- Hits        36495    36388     -107     
- Misses      11246    11353     +107     
  Partials      206      206              
Flag Coverage Δ
hive ?
mysql 80.67% <ø> (ø)
postgres 80.71% <ø> (?)
presto ?
python 80.79% <ø> (-0.42%) ⬇️
sqlite 80.31% <ø> (ø)

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

Impacted Files Coverage Δ
...nativeFilters/FilterBar/FilterSets/EditSection.tsx 80.00% <ø> (ø)
...tiveFilters/FilterBar/FilterSets/FiltersHeader.tsx 91.42% <ø> (ø)
...ents/nativeFilters/FilterBar/FilterSets/Footer.tsx 95.23% <ø> (ø)
...omponents/nativeFilters/FilterBar/Header/index.tsx 90.32% <ø> (ø)
...onfigModal/FiltersConfigForm/FiltersConfigForm.tsx 83.72% <ø> (ø)
...mponents/nativeFilters/FiltersConfigModal/utils.ts 34.24% <ø> (ø)
...nts/controls/DateFilterControl/DateFilterLabel.tsx 19.82% <0.00%> (ø)
superset-frontend/src/utils/common.js 87.71% <ø> (ø)
...nents/nativeFilters/FilterBar/FilterSets/index.tsx 46.93% <50.00%> (ø)
superset-frontend/src/components/Icon/index.tsx 100.00% <100.00%> (ø)
... and 29 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 9d67b46...354014b. Read the comment docs.

Comment on lines +136 to +138
"druid_time_origin": "druid_time_origin",
"time_grain_sqla": "time_grain_sqla",
"time_range_endpoints": "time_range_endpoints",
Copy link
Member Author

Choose a reason for hiding this comment

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

For legacy plugins (viz.py), these have to be mapped into the main form_data, as they are later mapped to extras where they should ultimately go:

superset/superset/viz.py

Lines 363 to 370 in 6119d8e

extras = {
"druid_time_origin": form_data.get("druid_time_origin", ""),
"having": form_data.get("having", ""),
"having_druid": form_data.get("having_filters", []),
"time_grain_sqla": form_data.get("time_grain_sqla"),
"time_range_endpoints": form_data.get("time_range_endpoints"),
"where": form_data.get("where", ""),
}

@villebro villebro merged commit 0807ab4 into apache:master Apr 20, 2021
@villebro villebro deleted the villebro/fix-merge-extra-form-data branch April 20, 2021 11:24
@junlincc junlincc added the dashboard:native-filters Related to the native filters of the Dashboard label Apr 26, 2021
QAlexBall pushed a commit to QAlexBall/superset that referenced this pull request Dec 29, 2021
…14244)

* fix: merge_extra_form_data extras processing

* move props that are later moved back in viz.py
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.2.0 labels Mar 12, 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 dashboard:native-filters Related to the native filters of the Dashboard preset-io size/S 🚢 1.2.0
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

4 participants