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

feat: generate label map on the backend #21124

Merged
merged 3 commits into from
Aug 22, 2022

Conversation

zhaoyongjie
Copy link
Member

@zhaoyongjie zhaoyongjie commented Aug 18, 2022

SUMMARY

Currently, the timeseries chart has a variable labelMap, used for mapping result columns(or series) and dimension values. If the result columns contain comma(,), this mapping can't reverse calculation dimension values on the frontend. This issue was blocked drill to detail.

This PR intends to generate labelMap on the backend. The frontend only needs to replace the labelMap from the chart query response.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

image

TESTING INSTRUCTIONS

Pure backend change, should pass all CI.

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

@zhaoyongjie zhaoyongjie marked this pull request as ready for review August 18, 2022 13:53
@zhaoyongjie zhaoyongjie changed the title feat: generate labe map on the backend feat: generate label map on the backend Aug 18, 2022
@codecov
Copy link

codecov bot commented Aug 18, 2022

Codecov Report

Merging #21124 (4dbffc7) into master (252ceb7) will decrease coverage by 11.45%.
The diff coverage is 100.00%.

❗ Current head 4dbffc7 differs from pull request most recent head 798c2a5. Consider uploading reports for the commit 798c2a5 to get more accurate results

@@             Coverage Diff             @@
##           master   #21124       +/-   ##
===========================================
- Coverage   66.32%   54.86%   -11.46%     
===========================================
  Files        1772     1772               
  Lines       67651    67662       +11     
  Branches     7205     7205               
===========================================
- Hits        44867    37123     -7744     
- Misses      20941    28696     +7755     
  Partials     1843     1843               
Flag Coverage Δ
hive 53.18% <75.00%> (+<0.01%) ⬆️
mysql ?
postgres ?
presto 53.07% <75.00%> (+<0.01%) ⬆️
python 57.82% <100.00%> (-23.69%) ⬇️
sqlite ?
unit 50.74% <83.33%> (+0.01%) ⬆️

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

Impacted Files Coverage Δ
superset/common/query_context_processor.py 62.60% <100.00%> (-25.89%) ⬇️
superset/utils/pandas_postprocessing/__init__.py 100.00% <100.00%> (ø)
superset/utils/pandas_postprocessing/flatten.py 100.00% <100.00%> (ø)
superset/utils/pandas_postprocessing/utils.py 96.55% <100.00%> (+0.39%) ⬆️
superset/utils/dashboard_import_export.py 0.00% <0.00%> (-100.00%) ⬇️
superset/key_value/commands/update.py 0.00% <0.00%> (-88.89%) ⬇️
superset/key_value/commands/delete.py 0.00% <0.00%> (-85.30%) ⬇️
superset/key_value/commands/delete_expired.py 0.00% <0.00%> (-80.77%) ⬇️
superset/dashboards/commands/importers/v0.py 15.62% <0.00%> (-76.25%) ⬇️
superset/datasets/commands/update.py 25.00% <0.00%> (-69.05%) ⬇️
... and 282 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/M labels Aug 19, 2022
@zhaoyongjie
Copy link
Member Author

/testenv up

@github-actions
Copy link
Contributor

@zhaoyongjie Ephemeral environment spinning up at http://54.148.237.28:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

Copy link
Member

@geido geido left a comment

Choose a reason for hiding this comment

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

Code LGTM!

@michael-s-molina
Copy link
Member

Thank you for the PR @zhaoyongjie.

I noticed the labelMap is not being correctly generated when using a pie chart. Is the objective of this PR to generate the labelMap on the server side for all chart types or just time series?

Screen.Recording.2022-08-22.at.8.35.13.AM.mov

@zhaoyongjie
Copy link
Member Author

zhaoyongjie commented Aug 22, 2022

@michael-s-molina Nice catch! I just realized that Pie has no make Pivot! for now, this feature just supports a chart that contains a pivot operator.

I also update the PR description.

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

@zhaoyongjie zhaoyongjie merged commit 11bf7b9 into apache:master Aug 22, 2022
@github-actions
Copy link
Contributor

Ephemeral environment shutdown and build artifacts deleted.

@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

4 participants