You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "michael-s-molina (via GitHub)" <gi...@apache.org> on 2023/11/29 19:01:56 UTC

[PR] feat: Adds legacy time support for Waterfall chart [superset]

michael-s-molina opened a new pull request, #26136:
URL: https://github.com/apache/superset/pull/26136

   ### SUMMARY
   Follow-up of https://github.com/apache/superset/pull/25557 to add support for legacy time controls in Waterfall charts.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   <img width="1754" alt="Screenshot 2023-11-29 at 15 47 46" src="https://github.com/apache/superset/assets/70410625/7c22ad84-7c98-48d9-a700-7217a1f13fb2">
   
   ### TESTING INSTRUCTIONS
   1 - Set `GENERIC_CHART_AXES` feature flag to False
   2 - Test if you are able to create a Waterfall chart using the legacy time controls
   
   ### ADDITIONAL INFORMATION
   - [ ] 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


Re: [PR] feat: Adds legacy time support for Waterfall chart [superset]

Posted by "villebro (via GitHub)" <gi...@apache.org>.
villebro commented on PR #26136:
URL: https://github.com/apache/superset/pull/26136#issuecomment-1834144463

   @michael-s-molina a general observation about this change - as we've already enabled `GENERIC_CHART_AXES` by default, do we really want to support non-generic mode in new viz types? This adds maintenance burden, and makes the task of deprecating those legacy controls even bigger. As an alternative, maybe we could just disable this chart type if generic chart axes is disabled?


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


Re: [PR] feat: Adds legacy time support for Waterfall chart [superset]

Posted by "michael-s-molina (via GitHub)" <gi...@apache.org>.
michael-s-molina commented on code in PR #26136:
URL: https://github.com/apache/superset/pull/26136#discussion_r1410677388


##########
superset-frontend/plugins/plugin-chart-echarts/src/Waterfall/controlPanel.tsx:
##########
@@ -17,25 +17,27 @@
  * under the License.
  */
 import React from 'react';
-import { t } from '@superset-ui/core';
+import { hasGenericChartAxes, t } from '@superset-ui/core';
 import {
   ControlPanelConfig,
   ControlSubSectionHeader,
   D3_TIME_FORMAT_DOCS,
   DEFAULT_TIME_FORMAT,
   formatSelectOptions,
+  sections,
   sharedControls,
 } from '@superset-ui/chart-controls';
 import { showValueControl } from '../controls';
 
 const config: ControlPanelConfig = {
   controlPanelSections: [
+    sections.genericTime,
     {
       label: t('Query'),
       expanded: true,
       controlSetRows: [
-        ['x_axis'],
-        ['time_grain_sqla'],
+        [hasGenericChartAxes ? 'x_axis' : null],

Review Comment:
   > Doesn't a row value of null result in an empty DOM placeholder?
   
   It does not. This pattern is used everywhere. 
   
   > How about conditionally appending generic x-axis control?
   
   we need to add the `x_axis` and `time_grain_sqla` into different arrays.



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


Re: [PR] feat: Adds legacy time support for Waterfall chart [superset]

Posted by "michael-s-molina (via GitHub)" <gi...@apache.org>.
michael-s-molina commented on PR #26136:
URL: https://github.com/apache/superset/pull/26136#issuecomment-1834233582

   > @michael-s-molina a general observation about this change - as we've already enabled GENERIC_CHART_AXES by default, do we really want to support non-generic mode in new viz types? This adds maintenance burden, and makes the task of deprecating those legacy controls even bigger. As an alternative, maybe we could just disable this chart type if generic chart axes is disabled?
   
   @villebro You're correct. I think there's no obligation to support non-generic mode in new viz types. I just did it for this chart because we want it at Airbnb but we didn't enable `GENERIC_CHART_AXES` yet. Luckily, 4.0 is coming (March 2024) to delete the legacy code and resolve our problems. We'll enable that feature flag by then.


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


Re: [PR] feat: Adds legacy time support for Waterfall chart [superset]

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #26136:
URL: https://github.com/apache/superset/pull/26136#issuecomment-1832569570

   ## [Codecov](https://app.codecov.io/gh/apache/superset/pull/26136?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   Attention: `5 lines` in your changes are missing coverage. Please review.
   > Comparison is base [(`b9aaf0f`)](https://app.codecov.io/gh/apache/superset/commit/b9aaf0fc057d44e99bcdb1c63b362b5608781644?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) 58.93% compared to head [(`e2cdce7`)](https://app.codecov.io/gh/apache/superset/pull/26136?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) 58.92%.
   > Report is 4 commits behind head on master.
   
   | [Files](https://app.codecov.io/gh/apache/superset/pull/26136?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
   |---|---|---|
   | [...lugin-chart-echarts/src/Waterfall/controlPanel.tsx](https://app.codecov.io/gh/apache/superset/pull/26136?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9wbHVnaW4tY2hhcnQtZWNoYXJ0cy9zcmMvV2F0ZXJmYWxsL2NvbnRyb2xQYW5lbC50c3g=) | 0.00% | [0 Missing and 2 partials :warning: ](https://app.codecov.io/gh/apache/superset/pull/26136?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [...ugin-chart-echarts/src/Waterfall/transformProps.ts](https://app.codecov.io/gh/apache/superset/pull/26136?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9wbHVnaW4tY2hhcnQtZWNoYXJ0cy9zcmMvV2F0ZXJmYWxsL3RyYW5zZm9ybVByb3BzLnRz) | 33.33% | [0 Missing and 2 partials :warning: ](https://app.codecov.io/gh/apache/superset/pull/26136?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [...s/plugin-chart-echarts/src/Waterfall/buildQuery.ts](https://app.codecov.io/gh/apache/superset/pull/26136?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9wbHVnaW4tY2hhcnQtZWNoYXJ0cy9zcmMvV2F0ZXJmYWxsL2J1aWxkUXVlcnkudHM=) | 50.00% | [0 Missing and 1 partial :warning: ](https://app.codecov.io/gh/apache/superset/pull/26136?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   
   <details><summary>Additional details and impacted files</summary>
   
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #26136      +/-   ##
   ==========================================
   - Coverage   58.93%   58.92%   -0.02%     
   ==========================================
     Files        1941     1941              
     Lines       75873    75888      +15     
     Branches     8447     8454       +7     
   ==========================================
     Hits        44714    44714              
   - Misses      28984    28996      +12     
   - Partials     2175     2178       +3     
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/superset/pull/26136/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [javascript](https://app.codecov.io/gh/apache/superset/pull/26136/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `56.26% <28.57%> (-0.03%)` | :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=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   
   </details>
   
   [:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/superset/pull/26136?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   


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


Re: [PR] feat: Adds legacy time support for Waterfall chart [superset]

Posted by "justinpark (via GitHub)" <gi...@apache.org>.
justinpark commented on code in PR #26136:
URL: https://github.com/apache/superset/pull/26136#discussion_r1409830168


##########
superset-frontend/plugins/plugin-chart-echarts/src/Waterfall/controlPanel.tsx:
##########
@@ -17,25 +17,27 @@
  * under the License.
  */
 import React from 'react';
-import { t } from '@superset-ui/core';
+import { hasGenericChartAxes, t } from '@superset-ui/core';
 import {
   ControlPanelConfig,
   ControlSubSectionHeader,
   D3_TIME_FORMAT_DOCS,
   DEFAULT_TIME_FORMAT,
   formatSelectOptions,
+  sections,
   sharedControls,
 } from '@superset-ui/chart-controls';
 import { showValueControl } from '../controls';
 
 const config: ControlPanelConfig = {
   controlPanelSections: [
+    sections.genericTime,
     {
       label: t('Query'),
       expanded: true,
       controlSetRows: [
-        ['x_axis'],
-        ['time_grain_sqla'],
+        [hasGenericChartAxes ? 'x_axis' : null],

Review Comment:
   Doesn't a row value of null result in an empty DOM placeholder?
   How about conditionally appending generic x-axis control?
   ```suggestion
           ...(hasGenericChartAxes ? ['x_axis', 'time_grain_sqla'] : []),
   ```



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


Re: [PR] feat: Adds legacy time support for Waterfall chart [superset]

Posted by "michael-s-molina (via GitHub)" <gi...@apache.org>.
michael-s-molina commented on code in PR #26136:
URL: https://github.com/apache/superset/pull/26136#discussion_r1410677388


##########
superset-frontend/plugins/plugin-chart-echarts/src/Waterfall/controlPanel.tsx:
##########
@@ -17,25 +17,27 @@
  * under the License.
  */
 import React from 'react';
-import { t } from '@superset-ui/core';
+import { hasGenericChartAxes, t } from '@superset-ui/core';
 import {
   ControlPanelConfig,
   ControlSubSectionHeader,
   D3_TIME_FORMAT_DOCS,
   DEFAULT_TIME_FORMAT,
   formatSelectOptions,
+  sections,
   sharedControls,
 } from '@superset-ui/chart-controls';
 import { showValueControl } from '../controls';
 
 const config: ControlPanelConfig = {
   controlPanelSections: [
+    sections.genericTime,
     {
       label: t('Query'),
       expanded: true,
       controlSetRows: [
-        ['x_axis'],
-        ['time_grain_sqla'],
+        [hasGenericChartAxes ? 'x_axis' : null],

Review Comment:
   > Doesn't a row value of null result in an empty DOM placeholder?
   
   It does not. This pattern is used everywhere. 
   
   > How about conditionally appending generic x-axis control?
   
   We need to add the `x_axis` and `time_grain_sqla` into different arrays.



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


Re: [PR] feat: Adds legacy time support for Waterfall chart [superset]

Posted by "michael-s-molina (via GitHub)" <gi...@apache.org>.
michael-s-molina merged PR #26136:
URL: https://github.com/apache/superset/pull/26136


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