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/05/03 19:03:57 UTC

[GitHub] [superset] prosdev0107 opened a new pull request, #19939: fix(chart & alert): make to show metrics properly

prosdev0107 opened a new pull request, #19939:
URL: https://github.com/apache/superset/pull/19939

   ### SUMMARY
   Altered Modal Doesn't Show Metrics Properly In Table Chart
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   BEFORE:
   ![image](https://user-images.githubusercontent.com/47900232/166524410-76b6cbec-7820-4283-9e5a-ec6a00d3ffc6.png)
   
   AFTER:
   ![image](https://user-images.githubusercontent.com/47900232/166524271-e1c97852-d123-4e55-a428-d077c3cf2379.png)
   
   ### TESTING INSTRUCTIONS
   **How to reproduce bug**
   
   1. Open a chart (table chart)
   2. Remove the column in the "Metric" field and add a different column
   3. Click the yellow "Altered" button at the top of the page
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] Has associated issue:
   - [ ] 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
   


-- 
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] ktmud commented on pull request #19939: fix(chart & alert): make to show metrics properly

Posted by GitBox <gi...@apache.org>.
ktmud commented on PR #19939:
URL: https://github.com/apache/superset/pull/19939#issuecomment-1117668202

   I don't think this is the right way to fix this issue.


-- 
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] prosdev0107 commented on a diff in pull request #19939: fix(chart & alert): make to show metrics properly

Posted by GitBox <gi...@apache.org>.
prosdev0107 commented on code in PR #19939:
URL: https://github.com/apache/superset/pull/19939#discussion_r865159148


##########
superset-frontend/plugins/plugin-chart-table/src/controlPanel.tsx:
##########
@@ -263,6 +263,7 @@ const config: ControlPanelConfig = {
           },
         ],
         ['adhoc_filters'],
+        ['metrics'],

Review Comment:
   The stranger thing is that it works normally on superset locally.



-- 
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] github-actions[bot] commented on pull request #19939: fix(chart & alert): make to show metrics properly

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #19939:
URL: https://github.com/apache/superset/pull/19939#issuecomment-1126333663

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


-- 
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] prosdev0107 commented on a diff in pull request #19939: fix(chart & alert): make to show metrics properly

Posted by GitBox <gi...@apache.org>.
prosdev0107 commented on code in PR #19939:
URL: https://github.com/apache/superset/pull/19939#discussion_r865427294


##########
superset-frontend/src/components/AlteredSliceTag/index.jsx:
##########
@@ -147,15 +147,12 @@ export default class AlteredSliceTag extends React.Component {
     if (controlsMap[key]?.type === 'CollectionControl') {
       return value.map(v => safeStringify(v)).join(', ');
     }
-    if (controlsMap[key]?.type === 'MetricsControl' && Array.isArray(value)) {
-      const formattedValue = value.map(v => (v.label ? v.label : v));
-      return formattedValue.length ? formattedValue.join(', ') : '[]';
-    }
     if (typeof value === 'boolean') {
       return value ? 'true' : 'false';
     }
     if (value.constructor === Array) {
-      return value.length ? value.join(', ') : '[]';
+      const formattedValue = value.map(v => (v.label ? v.label : v));

Review Comment:
   @diegomedina248 
   It does make sense. Resolved.



-- 
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] rusackas commented on pull request #19939: fix(chart & alert): make to show metrics properly

Posted by GitBox <gi...@apache.org>.
rusackas commented on PR #19939:
URL: https://github.com/apache/superset/pull/19939#issuecomment-1116611972

   /testenv up


-- 
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] diegomedina248 commented on a diff in pull request #19939: fix(chart & alert): make to show metrics properly

Posted by GitBox <gi...@apache.org>.
diegomedina248 commented on code in PR #19939:
URL: https://github.com/apache/superset/pull/19939#discussion_r865320778


##########
superset-frontend/src/components/AlteredSliceTag/index.jsx:
##########
@@ -147,15 +147,12 @@ export default class AlteredSliceTag extends React.Component {
     if (controlsMap[key]?.type === 'CollectionControl') {
       return value.map(v => safeStringify(v)).join(', ');
     }
-    if (controlsMap[key]?.type === 'MetricsControl' && Array.isArray(value)) {
-      const formattedValue = value.map(v => (v.label ? v.label : v));
-      return formattedValue.length ? formattedValue.join(', ') : '[]';
-    }
     if (typeof value === 'boolean') {
       return value ? 'true' : 'false';
     }
     if (value.constructor === Array) {
-      return value.length ? value.join(', ') : '[]';
+      const formattedValue = value.map(v => (v.label ? v.label : v));

Review Comment:
   This could potentially be called for other control types aside from metrics.
   Why did you move it from above? Was the code not entering? We're essentially switching from `Array.isArray` to `value.constructor`, which should have similar effect.
   If that's the only reason, we could replace `Array.isArray` with `value.constructor` in the other block you removed, but keeping it locked to the metrics control.



-- 
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] diegomedina248 commented on a diff in pull request #19939: fix(chart & alert): make to show metrics properly

Posted by GitBox <gi...@apache.org>.
diegomedina248 commented on code in PR #19939:
URL: https://github.com/apache/superset/pull/19939#discussion_r865359780


##########
superset-frontend/src/components/AlteredSliceTag/index.jsx:
##########
@@ -147,15 +147,12 @@ export default class AlteredSliceTag extends React.Component {
     if (controlsMap[key]?.type === 'CollectionControl') {
       return value.map(v => safeStringify(v)).join(', ');
     }
-    if (controlsMap[key]?.type === 'MetricsControl' && Array.isArray(value)) {
-      const formattedValue = value.map(v => (v.label ? v.label : v));
-      return formattedValue.length ? formattedValue.join(', ') : '[]';
-    }
     if (typeof value === 'boolean') {
       return value ? 'true' : 'false';
     }
     if (value.constructor === Array) {
-      return value.length ? value.join(', ') : '[]';
+      const formattedValue = value.map(v => (v.label ? v.label : v));

Review Comment:
   ```suggestion
         const formattedValue = value.map(v => (v?.label ?? v));
   ```



-- 
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] yousoph commented on pull request #19939: fix(chart & alert): make to show metrics properly

Posted by GitBox <gi...@apache.org>.
yousoph commented on PR #19939:
URL: https://github.com/apache/superset/pull/19939#issuecomment-1126323768

   /testenv up


-- 
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] prosdev0107 commented on a diff in pull request #19939: fix(chart & alert): make to show metrics properly

Posted by GitBox <gi...@apache.org>.
prosdev0107 commented on code in PR #19939:
URL: https://github.com/apache/superset/pull/19939#discussion_r865157752


##########
superset-frontend/plugins/plugin-chart-table/src/controlPanel.tsx:
##########
@@ -263,6 +263,7 @@ const config: ControlPanelConfig = {
           },
         ],
         ['adhoc_filters'],
+        ['metrics'],

Review Comment:
   Let me check



-- 
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] diegomedina248 commented on a diff in pull request #19939: fix(chart & alert): make to show metrics properly

Posted by GitBox <gi...@apache.org>.
diegomedina248 commented on code in PR #19939:
URL: https://github.com/apache/superset/pull/19939#discussion_r865155967


##########
superset-frontend/plugins/plugin-chart-table/src/controlPanel.tsx:
##########
@@ -263,6 +263,7 @@ const config: ControlPanelConfig = {
           },
         ],
         ['adhoc_filters'],
+        ['metrics'],

Review Comment:
   check instead what is the other `metrics` panel doing, it must be transforming the props or something



-- 
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 #19939: fix(chart & alert): make to show metrics properly

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

   # [Codecov](https://codecov.io/gh/apache/superset/pull/19939?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 [#19939](https://codecov.io/gh/apache/superset/pull/19939?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (9a735cb) into [master](https://codecov.io/gh/apache/superset/commit/e1f53f2a2c877a7f95402a1af5608c7a8e2ae27c?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (e1f53f2) will **decrease** coverage by `0.00%`.
   > The diff coverage is `20.00%`.
   
   > :exclamation: Current head 9a735cb differs from pull request most recent head dae3bdc. Consider uploading reports for the commit dae3bdc to get more accurate results
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #19939      +/-   ##
   ==========================================
   - Coverage   66.53%   66.53%   -0.01%     
   ==========================================
     Files        1714     1714              
     Lines       65044    65048       +4     
     Branches     6723     6724       +1     
   ==========================================
     Hits        43278    43278              
   - Misses      20055    20059       +4     
     Partials     1711     1711              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | javascript | `51.26% <20.00%> (-0.01%)` | :arrow_down: |
   
   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/19939?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...nd/plugins/plugin-chart-table/src/controlPanel.tsx](https://codecov.io/gh/apache/superset/pull/19939/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-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9wbHVnaW4tY2hhcnQtdGFibGUvc3JjL2NvbnRyb2xQYW5lbC50c3g=) | `16.66% <ø> (ø)` | |
   | [...frontend/src/SqlLab/components/ResultSet/index.tsx](https://codecov.io/gh/apache/superset/pull/19939/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9jb21wb25lbnRzL1Jlc3VsdFNldC9pbmRleC50c3g=) | `50.49% <ø> (ø)` | |
   | [...-frontend/src/components/FilterableTable/index.tsx](https://codecov.io/gh/apache/superset/pull/19939/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvRmlsdGVyYWJsZVRhYmxlL2luZGV4LnRzeA==) | `70.00% <20.00%> (ø)` | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/19939?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/19939?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 [e1f53f2...dae3bdc](https://codecov.io/gh/apache/superset/pull/19939?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] github-actions[bot] commented on pull request #19939: fix(chart & alert): make to show metrics properly

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #19939:
URL: https://github.com/apache/superset/pull/19939#issuecomment-1128099872

   Ephemeral environment shutdown and build artifacts deleted.


-- 
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] prosdev0107 commented on a diff in pull request #19939: fix(chart & alert): make to show metrics properly

Posted by GitBox <gi...@apache.org>.
prosdev0107 commented on code in PR #19939:
URL: https://github.com/apache/superset/pull/19939#discussion_r865159148


##########
superset-frontend/plugins/plugin-chart-table/src/controlPanel.tsx:
##########
@@ -263,6 +263,7 @@ const config: ControlPanelConfig = {
           },
         ],
         ['adhoc_filters'],
+        ['metrics'],

Review Comment:
   The stranger thing is that it works normally on superset locally.



-- 
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] yousoph commented on pull request #19939: fix(chart & alert): make to show metrics properly

Posted by GitBox <gi...@apache.org>.
yousoph commented on PR #19939:
URL: https://github.com/apache/superset/pull/19939#issuecomment-1116774734

   @prosdev0107 I see metrics twice in the control panel now: 
   ![image](https://user-images.githubusercontent.com/10627051/166605196-02de3ab4-b1b0-408a-8319-84991c2c4d00.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] github-actions[bot] commented on pull request #19939: fix(chart & alert): make to show metrics properly

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #19939:
URL: https://github.com/apache/superset/pull/19939#issuecomment-1116618005

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


-- 
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] yousoph commented on pull request #19939: fix(chart & alert): make to show metrics properly

Posted by GitBox <gi...@apache.org>.
yousoph commented on PR #19939:
URL: https://github.com/apache/superset/pull/19939#issuecomment-1126417605

   a quick test on the ephemeral was looking good to me 


-- 
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] rusackas merged pull request #19939: fix(chart & alert): make to show metrics properly

Posted by GitBox <gi...@apache.org>.
rusackas merged PR #19939:
URL: https://github.com/apache/superset/pull/19939


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