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(word cloud): series label format fixed for custom sql queries #23517

Merged
merged 3 commits into from
Mar 30, 2023

Conversation

ashgorithm
Copy link
Contributor

fix(word cloud) - issue #19975 - series label format fixed for custom sql queries

SUMMARY

This is a fix for issue
#19975
For custom sql queries the type of series field is different from string. Made changes to the interface LegacyWordCloudFormData interface and series label in encoding.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

before:
Screenshot from 2023-03-28 12-12-58

after:
Screenshot from 2023-03-28 12-09-53

TESTING INSTRUCTIONS

  1. select Girl names chart word cloud
  2. for dimension, select custom sql as upper(name)
  3. word cloud with upper case names should be rendered.

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
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Congrats on making your first PR and thank you for contributing to Superset! 🎉 ❤️

We hope to see you in our Slack community too! Not signed up? Use our Slack App to self-register.

Copy link
Member

@villebro villebro left a comment

Choose a reason for hiding this comment

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

Thanks for the fix! Please use getColumnLabel

Comment on lines 37 to 46
function getSeriesLabel(
series: LegacyWordCloudFormData['series'],
): string | undefined {
if (typeof series === 'string' || typeof series === 'undefined') {
return series;
}

return series.label;
}

Copy link
Member

Choose a reason for hiding this comment

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

I just did a very similar fix yesterday to the Heatmap plugin. Please check the getColumnLabel util and how it can be used here: #23507

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for pointing me to the util function! I have made the changes.

@villebro villebro changed the title fix(word cloud) - issue #19975 - series label format fixed for custom sql queries fix(word cloud): series label format fixed for custom sql queries Mar 29, 2023
Copy link
Member

@villebro villebro left a comment

Choose a reason for hiding this comment

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

Nice, LGTM! 🎉

@codecov
Copy link

codecov bot commented Mar 30, 2023

Codecov Report

Merging #23517 (e3dfed8) into master (5d910aa) will increase coverage by 0.01%.
The diff coverage is 66.52%.

❗ Current head e3dfed8 differs from pull request most recent head 6e02474. Consider uploading reports for the commit 6e02474 to get more accurate results

@@            Coverage Diff             @@
##           master   #23517      +/-   ##
==========================================
+ Coverage   67.63%   67.64%   +0.01%     
==========================================
  Files        1910     1914       +4     
  Lines       73746    73926     +180     
  Branches     7987     8020      +33     
==========================================
+ Hits        49878    50010     +132     
- Misses      21826    21873      +47     
- Partials     2042     2043       +1     
Flag Coverage Δ
javascript 53.89% <54.37%> (+0.04%) ⬆️
postgres ?

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

Impacted Files Coverage Δ
.../packages/superset-ui-core/src/chart/types/Base.ts 100.00% <ø> (ø)
...gins/legacy-plugin-chart-world-map/src/WorldMap.js 0.00% <0.00%> (ø)
...plugins/legacy-plugin-chart-world-map/src/index.js 66.66% <ø> (ø)
.../plugins/plugin-chart-echarts/src/BoxPlot/index.ts 50.00% <ø> (ø)
...d/plugins/plugin-chart-echarts/src/Funnel/index.ts 50.00% <ø> (ø)
...nd/plugins/plugin-chart-echarts/src/Gauge/index.ts 50.00% <ø> (ø)
...ns/plugin-chart-echarts/src/Graph/EchartsGraph.tsx 0.00% <0.00%> (ø)
...nd/plugins/plugin-chart-echarts/src/Graph/index.ts 50.00% <ø> (ø)
...rts/src/MixedTimeseries/EchartsMixedTimeseries.tsx 0.00% <0.00%> (ø)
.../plugin-chart-echarts/src/MixedTimeseries/index.ts 25.00% <ø> (ø)
... and 45 more

... and 16 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@villebro villebro merged commit 41ad944 into apache:master Mar 30, 2023
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 3.0.0 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/S 🚢 3.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants