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: support non-string groupbys for pie chart #10493

Merged
merged 2 commits into from
Jul 31, 2020

Conversation

villebro
Copy link
Member

@villebro villebro commented Jul 31, 2020

SUMMARY

This adds support for non-string labels to the Pie Chart Viz and uses NULL_STRING if a pie label is None. Also removes decimals for float groupbys that satisfy is_integer(). This is needed, as all int columns become float if they contain NULLs (Pandas limitation).

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

image

TEST PLAN

CI + new tests + local testing

ADDITIONAL INFORMATION

@villebro villebro changed the title chore: add unit tests to pie chart fix: support non-string labels for pie chart Jul 31, 2020
Copy link
Member

@ktmud ktmud left a comment

Choose a reason for hiding this comment

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

LGTM! Than's for the quick and very comprehensive fix!

base_df = pd.DataFrame(
data={
"intcol": [1, 2, 3, 4],
"floatcol": [0.1, 0.2, 0.3, 0.4],
Copy link
Member

Choose a reason for hiding this comment

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

Would it help to insert a couple of Nones in these columns as well? And maybe add a boolean column, too?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch, numeric nulls were not properly handled (showed up as nan), adding tests.

@villebro villebro changed the title fix: support non-string labels for pie chart fix: support non-string groupbys for pie chart Jul 31, 2020
@villebro villebro requested a review from ktmud July 31, 2020 07:12
Copy link
Member

@ktmud ktmud left a comment

Choose a reason for hiding this comment

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

looking good!

@villebro villebro merged commit 9d9c348 into apache:master Jul 31, 2020
@villebro villebro deleted the villebro/pie-chart-tests branch July 31, 2020 08:19
JasonD28 pushed a commit to JasonD28/incubator-superset that referenced this pull request Aug 3, 2020
* chore: add unit tests to pie chart

* refine logic for floats and nans and add more tests
villebro added a commit to preset-io/superset that referenced this pull request Aug 20, 2020
* chore: add unit tests to pie chart

* refine logic for floats and nans and add more tests
craig-rueda pushed a commit to preset-io/superset that referenced this pull request Aug 24, 2020
* chore: add unit tests to pie chart

* refine logic for floats and nans and add more tests
villebro added a commit that referenced this pull request Sep 5, 2020
* chore: add unit tests to pie chart

* refine logic for floats and nans and add more tests
villebro added a commit that referenced this pull request Sep 16, 2020
* chore: add unit tests to pie chart

* refine logic for floats and nans and add more tests
auxten pushed a commit to auxten/incubator-superset that referenced this pull request Nov 20, 2020
* chore: add unit tests to pie chart

* refine logic for floats and nans and add more tests
cccs-rc pushed a commit to CybercentreCanada/superset that referenced this pull request Mar 6, 2024
* chore: add unit tests to pie chart

* refine logic for floats and nans and add more tests
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.38.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 size/M v0.37 v0.37.2 🍒 0.37.2 🚢 0.38.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants