You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2022/01/28 13:21:30 UTC

[GitHub] [superset] kgabryje opened a new pull request #18216: fix(explore): Pie chart label formatting when series is temporal

kgabryje opened a new pull request #18216:
URL: https://github.com/apache/superset/pull/18216


   ### SUMMARY
   When the label formatting was deciding whether to use number formatter or time formatter, it first checked if value is a number and if not, it checked if value is Date or column type is temporal. Timestamp values are numbers, so the first condition was true and number formatter was being used for timestamps. This PR switches the order of checks so that we first check if column is temporal.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   Before: see linked issue
   After:
   ![image](https://user-images.githubusercontent.com/15073128/151553415-b7e6de4f-25dc-436c-b16a-4977f4b0e937.png)
   
   ### TESTING INSTRUCTIONS
   <!--- Required! What steps can be taken to manually verify the changes? -->
   1. Create a Pie chart
   2. Select a temporal column as group by
   3. Verify that label names are formatted properly
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [] Has associated issue: #13293
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] 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
   
   CC @rusackas 
   
   https://app.shortcut.com/preset/story/34104/gh-13293-prod-37-pie-chart-date-format


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] kgabryje merged pull request #18216: fix(explore): Pie chart label formatting when series is temporal

Posted by GitBox <gi...@apache.org>.
kgabryje merged pull request #18216:
URL: https://github.com/apache/superset/pull/18216


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] zhaoyongjie commented on a change in pull request #18216: fix(explore): Pie chart label formatting when series is temporal

Posted by GitBox <gi...@apache.org>.
zhaoyongjie commented on a change in pull request #18216:
URL: https://github.com/apache/superset/pull/18216#discussion_r794565571



##########
File path: superset-frontend/plugins/plugin-chart-echarts/src/utils/series.ts
##########
@@ -88,9 +88,6 @@ export function formatSeriesName(
   if (name === undefined || name === null) {
     return NULL_STRING;
   }
-  if (typeof name === 'number') {

Review comment:
       thanks for the explanation.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] zhaoyongjie commented on a change in pull request #18216: fix(explore): Pie chart label formatting when series is temporal

Posted by GitBox <gi...@apache.org>.
zhaoyongjie commented on a change in pull request #18216:
URL: https://github.com/apache/superset/pull/18216#discussion_r794517550



##########
File path: superset-frontend/plugins/plugin-chart-echarts/src/utils/series.ts
##########
@@ -88,9 +88,6 @@ export function formatSeriesName(
   if (name === undefined || name === null) {
     return NULL_STRING;
   }
-  if (typeof name === 'number') {

Review comment:
       Sorry for this stupid question: just move the location? Did the code change?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] kgabryje commented on a change in pull request #18216: fix(explore): Pie chart label formatting when series is temporal

Posted by GitBox <gi...@apache.org>.
kgabryje commented on a change in pull request #18216:
URL: https://github.com/apache/superset/pull/18216#discussion_r794538978



##########
File path: superset-frontend/plugins/plugin-chart-echarts/src/utils/series.ts
##########
@@ -88,9 +88,6 @@ export function formatSeriesName(
   if (name === undefined || name === null) {
     return NULL_STRING;
   }
-  if (typeof name === 'number') {

Review comment:
       Yep, just like Ville said :)




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov[bot] commented on pull request #18216: fix(explore): Pie chart label formatting when series is temporal

Posted by GitBox <gi...@apache.org>.
codecov[bot] commented on pull request #18216:
URL: https://github.com/apache/superset/pull/18216#issuecomment-1024257752


   # [Codecov](https://codecov.io/gh/apache/superset/pull/18216?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#18216](https://codecov.io/gh/apache/superset/pull/18216?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (9f66652) into [master](https://codecov.io/gh/apache/superset/commit/0a91a6880a0769ace79224b9a967eec6a685d03d?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (0a91a68) will **increase** coverage by `14.40%`.
   > The diff coverage is `100.00%`.
   
   > :exclamation: Current head 9f66652 differs from pull request most recent head 3fa517a. Consider uploading reports for the commit 3fa517a to get more accurate results
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/18216/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/superset/pull/18216?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff             @@
   ##           master   #18216       +/-   ##
   ===========================================
   + Coverage   51.64%   66.05%   +14.40%     
   ===========================================
     Files        1591     1591               
     Lines       62423    62423               
     Branches     6287     6287               
   ===========================================
   + Hits        32240    41234     +8994     
   + Misses      28561    19567     -8994     
     Partials     1622     1622               
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | javascript | `50.86% <100.00%> (ø)` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/18216?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...d/plugins/plugin-chart-echarts/src/utils/series.ts](https://codecov.io/gh/apache/superset/pull/18216/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9wbHVnaW4tY2hhcnQtZWNoYXJ0cy9zcmMvdXRpbHMvc2VyaWVzLnRz) | `92.95% <100.00%> (ø)` | |
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/18216/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29uZmlnLnB5) | `91.90% <0.00%> (+0.31%)` | :arrow_up: |
   | [superset/initialization/\_\_init\_\_.py](https://codecov.io/gh/apache/superset/pull/18216/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvaW5pdGlhbGl6YXRpb24vX19pbml0X18ucHk=) | `90.20% <0.00%> (+1.68%)` | :arrow_up: |
   | [superset/databases/commands/exceptions.py](https://codecov.io/gh/apache/superset/pull/18216/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvZGF0YWJhc2VzL2NvbW1hbmRzL2V4Y2VwdGlvbnMucHk=) | `94.00% <0.00%> (+2.00%)` | :arrow_up: |
   | [superset/common/query\_object\_factory.py](https://codecov.io/gh/apache/superset/pull/18216/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29tbW9uL3F1ZXJ5X29iamVjdF9mYWN0b3J5LnB5) | `89.79% <0.00%> (+2.04%)` | :arrow_up: |
   | [superset/extensions.py](https://codecov.io/gh/apache/superset/pull/18216/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvZXh0ZW5zaW9ucy5weQ==) | `93.90% <0.00%> (+2.43%)` | :arrow_up: |
   | [superset/charts/data/commands/get\_data\_command.py](https://codecov.io/gh/apache/superset/pull/18216/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY2hhcnRzL2RhdGEvY29tbWFuZHMvZ2V0X2RhdGFfY29tbWFuZC5weQ==) | `100.00% <0.00%> (+3.70%)` | :arrow_up: |
   | [superset/views/sql\_lab.py](https://codecov.io/gh/apache/superset/pull/18216/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdmlld3Mvc3FsX2xhYi5weQ==) | `60.68% <0.00%> (+4.13%)` | :arrow_up: |
   | [superset/charts/commands/exceptions.py](https://codecov.io/gh/apache/superset/pull/18216/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY2hhcnRzL2NvbW1hbmRzL2V4Y2VwdGlvbnMucHk=) | `91.48% <0.00%> (+4.25%)` | :arrow_up: |
   | [superset/views/schedules.py](https://codecov.io/gh/apache/superset/pull/18216/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdmlld3Mvc2NoZWR1bGVzLnB5) | `64.49% <0.00%> (+4.34%)` | :arrow_up: |
   | ... and [267 more](https://codecov.io/gh/apache/superset/pull/18216/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/18216?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/18216?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [0a91a68...3fa517a](https://codecov.io/gh/apache/superset/pull/18216?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] villebro commented on a change in pull request #18216: fix(explore): Pie chart label formatting when series is temporal

Posted by GitBox <gi...@apache.org>.
villebro commented on a change in pull request #18216:
URL: https://github.com/apache/superset/pull/18216#discussion_r794525158



##########
File path: superset-frontend/plugins/plugin-chart-echarts/src/utils/series.ts
##########
@@ -88,9 +88,6 @@ export function formatSeriesName(
   if (name === undefined || name === null) {
     return NULL_STRING;
   }
-  if (typeof name === 'number') {

Review comment:
       The order of these affects the result - temporal columns are almost always epochs (`number`), and therefore the number formatter was always used on them. Now the "original" type of the column is first checked (based on `is_dttm` coming from the backend), so temporal numerical names will now be properly identified.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org