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 2021/09/01 11:51:56 UTC

[GitHub] [superset] intgr opened a new issue #16543: Multiple SQL metrics with auto-generated labels are collapsed into one

intgr opened a new issue #16543:
URL: https://github.com/apache/superset/issues/16543


   When creating a chart and adding multiple "custom SQL" metrics, the frontend seems to truncate them to generate the label. If this truncated label is not unique, then only one of the several metrics will be displayed.
   
   I frequently create multiple metrics like:
   ```sql
   SUM(vaccinations) FILTER (WHERE agegroup<=17)
   SUM(vaccinations) FILTER (WHERE agegroup BETWEEN 18 AND 39)
   SUM(vaccinations) FILTER (WHERE agegroup BETWEEN 40 AND 59)
   SUM(vaccinations) FILTER (WHERE agegroup>=60)
   ```
   All of these will have the same generated label `SUM(vaccinations) FILTER (WHERE agegroup...`
   
   ### Workaround
   
   Manually distinct adding labels solves this issue. That's a good idea in any case, but a bit extra work when prototyping.
   
   ### Expected results
   
   If I add multiple metrics, I want to see multiple metrics in the resulting graph.
   
   ### Actual results
   
   Only one of many metrics is displayed.
   
   #### Screenshots
   
   ![image](https://user-images.githubusercontent.com/137616/131665196-b834d0c6-0180-4717-b474-d489da7ffece.png)
   
   #### How to reproduce the bug
   
   1. Create new chart.
   2. Add multiple "custom SQL" metrics with identical first 40 characters.
   3. Run
   
   ### Environment
   
   (please complete the following information):
   
   - superset version: 0.0.0dev; git hash 80c39daa85c9be9e66a2e3cf2c9e2a8e5a74a8d6
   - python version: 3.9.6
   - node.js version: 16.8.0
   - any feature flags active: (no, using default config)
   
   ### Checklist
   
   Make sure to follow these steps before submitting your issue - thank you!
   
   - [x] I have checked the superset logs for python stacktraces and included it here as text if there are any.
   - [x] I have reproduced the issue with at least the latest released version of superset.
   - [x] I have checked the issue tracker for the same issue and I haven't found one similar.
   


-- 
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 edited a comment on issue #16543: Multiple SQL metrics with auto-generated labels are collapsed into one

Posted by GitBox <gi...@apache.org>.
villebro edited a comment on issue #16543:
URL: https://github.com/apache/superset/issues/16543#issuecomment-910273644


   This is happening here: https://github.com/apache/superset/blob/80c39daa85c9be9e66a2e3cf2c9e2a8e5a74a8d6/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilter/index.js#L182
   
   The correct behavior should be to not physically truncate the label, but to visually handle the overflow with ellipsis. So the appearance should be unchanged like this:
   ![image](https://user-images.githubusercontent.com/33317356/131677214-3847524a-e87d-4d55-aa49-ae4ad260b3a4.png)
   
   with the label value being untruncated (currently this widens very uglily when exceeding 43 chars):
   ![image](https://user-images.githubusercontent.com/33317356/131677024-eb28aae7-649c-40e1-aefa-19c26c62d32d.png)
   


-- 
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 issue #16543: Multiple SQL metrics with auto-generated labels are collapsed into one

Posted by GitBox <gi...@apache.org>.
villebro commented on issue #16543:
URL: https://github.com/apache/superset/issues/16543#issuecomment-910273644


   This is happening here: https://github.com/apache/superset/blob/80c39daa85c9be9e66a2e3cf2c9e2a8e5a74a8d6/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilter/index.js#L182
   
   The correct behavior should be to not physically truncate the label, but to handle the overflow with ellipsis. So the appearance should be unchanged like this:
   ![image](https://user-images.githubusercontent.com/33317356/131677214-3847524a-e87d-4d55-aa49-ae4ad260b3a4.png)
   
   with the label value being untruncated (currently this widens very ugly when exceeding 43 chars):
   ![image](https://user-images.githubusercontent.com/33317356/131677024-eb28aae7-649c-40e1-aefa-19c26c62d32d.png)
   


-- 
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] intgr commented on issue #16543: Multiple SQL metrics with auto-generated labels are collapsed into one

Posted by GitBox <gi...@apache.org>.
intgr commented on issue #16543:
URL: https://github.com/apache/superset/issues/16543#issuecomment-910298229


   Ah, I saw that truncation code, but I assumed that was intentional and the fix should be done somewhere else.
   
   I'll give it a shot, thanks.


-- 
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 edited a comment on issue #16543: Multiple SQL metrics with auto-generated labels are collapsed into one

Posted by GitBox <gi...@apache.org>.
villebro edited a comment on issue #16543:
URL: https://github.com/apache/superset/issues/16543#issuecomment-910273644


   This is happening here: https://github.com/apache/superset/blob/80c39daa85c9be9e66a2e3cf2c9e2a8e5a74a8d6/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilter/index.js#L182
   
   The correct behavior should be to not physically truncate the label, but to visually handle the overflow with ellipsis. So the appearance should be unchanged like this:
   ![image](https://user-images.githubusercontent.com/33317356/131677214-3847524a-e87d-4d55-aa49-ae4ad260b3a4.png)
   
   with the label value being untruncated (currently this widens very ugly when exceeding 43 chars):
   ![image](https://user-images.githubusercontent.com/33317356/131677024-eb28aae7-649c-40e1-aefa-19c26c62d32d.png)
   


-- 
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] intgr commented on issue #16543: Multiple SQL metrics with auto-generated labels are collapsed into one

Posted by GitBox <gi...@apache.org>.
intgr commented on issue #16543:
URL: https://github.com/apache/superset/issues/16543#issuecomment-910211019


   I tried to fix this myself, but could not identify the part of code where this "deduplication" of metrics happens.
   
   It seems it's in the frontend somewhere, since only one metric is in the "chart data" request.
   
   If someone has pointers, I'll gladly try to fix it myself and open a PR.
   


-- 
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 issue #16543: Multiple SQL metrics with auto-generated labels are collapsed into one

Posted by GitBox <gi...@apache.org>.
villebro commented on issue #16543:
URL: https://github.com/apache/superset/issues/16543#issuecomment-910261229


   I take that back: the label is incorrectly set by the metric popover: 
   ![image](https://user-images.githubusercontent.com/33317356/131675679-258ff2fc-a411-42dd-9e79-9b69bbf30f86.png)
   


-- 
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 issue #16543: Multiple SQL metrics with auto-generated labels are collapsed into one

Posted by GitBox <gi...@apache.org>.
villebro commented on issue #16543:
URL: https://github.com/apache/superset/issues/16543#issuecomment-910257953


   Thanks for flagging @intgr! Tested and reproduced, so this is indeed a bug/regression. I chcked that the request is using untruncated labels, so truncation is happening in the backend. Let me dig where this is happening so you can see if you want to take a stab at fixing it.


-- 
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 issue #16543: Multiple SQL metrics with auto-generated labels are collapsed into one

Posted by GitBox <gi...@apache.org>.
villebro commented on issue #16543:
URL: https://github.com/apache/superset/issues/16543#issuecomment-910370255


   FYI @intgr, I know @geido has done some great related work, so you can check his PRs or potentially reach out to him for guidance.


-- 
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