You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "lilykuang (via GitHub)" <gi...@apache.org> on 2023/04/14 23:42:58 UTC

[GitHub] [superset] lilykuang opened a new pull request, #23698: feat: format timestamps in drill by breadcrumbs

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

   <!---
   Please write the PR title following the conventions at https://www.conventionalcommits.org/en/v1.0.0/
   Example:
   fix(dashboard): load charts correctly
   -->
   
   ### SUMMARY
   <!--- Describe the change below, including rationale and design decisions -->
   -  format timestamps in breadcrumbs for drill by
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   <!--- Skip this if not applicable -->
   
   ### TESTING INSTRUCTIONS
   <!--- Required! What steps can be taken to manually verify the changes? -->
   
   ### 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] kgabryje commented on a diff in pull request #23698: feat: format timestamps in drill by breadcrumbs

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


##########
superset-frontend/plugins/plugin-chart-echarts/src/Graph/EchartsGraph.tsx:
##########
@@ -143,7 +150,18 @@ export default function EchartsGraph({
           drillToDetail: drillToDetailFilters,
           crossFilter: getCrossFilterDataMask(node),
           drillBy: node && {
-            filters: [{ col: node.col, op: '==', val: node.name }],
+            filters: [
+              {
+                col: node.col,
+                op: '==',
+                val: node.name,
+                formattedVal: formatSeriesName(node.name, {
+                  timeFormatter: getTimeFormatter(node.name),

Review Comment:
   The argument of `getTimeFormatter/getNumberFormatter` should be the time/number format selected by the user, available in `formData.dateFormat/formData.numberFormat` (or sth similar, not sure if the field name is the same for all charts)



-- 
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] lilykuang merged pull request #23698: feat: format timestamps in drill by breadcrumbs

Posted by "lilykuang (via GitHub)" <gi...@apache.org>.
lilykuang merged PR #23698:
URL: https://github.com/apache/superset/pull/23698


-- 
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 diff in pull request #23698: feat: format timestamps in drill by breadcrumbs

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


##########
superset-frontend/plugins/legacy-plugin-chart-world-map/src/WorldMap.js:
##########
@@ -187,6 +192,10 @@ function WorldMap(element, props) {
           col: entity,
           op: '==',
           val,
+          formattedVal:
+            getColumnLabel(entity) === formData.granularitySqla
+              ? String(timestampFormatter(val))
+              : String(val),

Review Comment:
   While this will probably work well in legacy charts that still have a time section, this won't work for "modern" charts that don't have a time section when `GENERIC_CHART_AXES` is enabled. For this chart this might be the correct solution, as I don't remember if `viz.py` returns `colnames` (=all columns) and `coltypes` (=the respective datatypes for said columns), but at least for charts that are powered by the v1 chart API we should check if the datatype of the column is `GenericDataType.TEMPORAL`, and if so, format it with `timestampFormatter`.



##########
superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/EchartsMixedTimeseries.tsx:
##########
@@ -167,6 +171,10 @@ export default function EchartsMixedTimeseries({
               col: dimension,
               op: '==',
               val: values[i],
+              formattedVal:
+                DTTM_ALIAS === getColumnLabel(dimension)
+                  ? String(timestampFormatter(values[i]))
+                  : String(values[i]),

Review Comment:
   same here, `DTTM_ALIAS` is already mostly deprecated, so we should refrain from using it in these types of checks. Again, this might be the correct solution for legacy charts that are powered by `viz.py`, but in the ECharts plugin we should not be using `DTTM_ALIAS` anymore.



-- 
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 diff in pull request #23698: feat: format timestamps in drill by breadcrumbs

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


##########
superset-frontend/plugins/legacy-plugin-chart-world-map/src/WorldMap.js:
##########
@@ -165,12 +168,14 @@ function WorldMap(element, props) {
     }
   };
 
-  const handleContextMenu = source => {
+  const handleContextMenu = async source => {

Review Comment:
   Same in other charts



-- 
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 diff in pull request #23698: feat: format timestamps in drill by breadcrumbs

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


##########
superset-frontend/plugins/legacy-plugin-chart-world-map/src/WorldMap.js:
##########
@@ -187,6 +192,10 @@ function WorldMap(element, props) {
           col: entity,
           op: '==',
           val,
+          formattedVal:
+            getColumnLabel(entity) === formData.granularitySqla
+              ? String(timestampFormatter(val))
+              : String(val),

Review Comment:
   Tested with Pie Chart with GENERIC_CHART_AXES enabled, can confirm that it doesn't work as expected :( 



-- 
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 diff in pull request #23698: feat: format timestamps in drill by breadcrumbs

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


##########
superset-frontend/plugins/legacy-plugin-chart-world-map/src/WorldMap.js:
##########
@@ -165,12 +168,14 @@ function WorldMap(element, props) {
     }
   };
 
-  const handleContextMenu = source => {
+  const handleContextMenu = async source => {

Review Comment:
   Nit in addition to Ville's comments - I think we don't need that `async` here anymore?



-- 
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 #23698: feat: format timestamps in drill by breadcrumbs

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

   ## [Codecov](https://codecov.io/gh/apache/superset/pull/23698?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 [#23698](https://codecov.io/gh/apache/superset/pull/23698?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (5455e13) into [master](https://codecov.io/gh/apache/superset/commit/b39edc1002f6620b0ae71f96be3df8f9f27070bb?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (b39edc1) will **increase** coverage by `1.77%`.
   > The diff coverage is `49.51%`.
   
   > :exclamation: Current head 5455e13 differs from pull request most recent head 6855dc1. Consider uploading reports for the commit 6855dc1 to get more accurate results
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #23698      +/-   ##
   ==========================================
   + Coverage   66.30%   68.07%   +1.77%     
   ==========================================
     Files        1922     1923       +1     
     Lines       74048    74154     +106     
     Branches     8104     8108       +4     
   ==========================================
   + Hits        49094    50478    +1384     
   + Misses      22882    21599    -1283     
   - Partials     2072     2077       +5     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | javascript | `54.08% <36.36%> (-0.05%)` | :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/23698?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...ackages/superset-ui-chart-controls/src/fixtures.ts](https://codecov.io/gh/apache/superset/pull/23698?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvcGFja2FnZXMvc3VwZXJzZXQtdWktY2hhcnQtY29udHJvbHMvc3JjL2ZpeHR1cmVzLnRz) | `100.00% <ø> (ø)` | |
   | [...d/packages/superset-ui-chart-controls/src/types.ts](https://codecov.io/gh/apache/superset/pull/23698?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvcGFja2FnZXMvc3VwZXJzZXQtdWktY2hhcnQtY29udHJvbHMvc3JjL3R5cGVzLnRz) | `100.00% <ø> (ø)` | |
   | [...s/superset-ui-core/src/components/SafeMarkdown.tsx](https://codecov.io/gh/apache/superset/pull/23698?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvcGFja2FnZXMvc3VwZXJzZXQtdWktY29yZS9zcmMvY29tcG9uZW50cy9TYWZlTWFya2Rvd24udHN4) | `85.71% <0.00%> (+19.04%)` | :arrow_up: |
   | [...ackages/superset-ui-core/src/utils/featureFlags.ts](https://codecov.io/gh/apache/superset/pull/23698?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvcGFja2FnZXMvc3VwZXJzZXQtdWktY29yZS9zcmMvdXRpbHMvZmVhdHVyZUZsYWdzLnRz) | `100.00% <ø> (ø)` | |
   | [...gins/legacy-plugin-chart-world-map/src/WorldMap.js](https://codecov.io/gh/apache/superset/pull/23698?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9sZWdhY3ktcGx1Z2luLWNoYXJ0LXdvcmxkLW1hcC9zcmMvV29ybGRNYXAuanM=) | `0.00% <0.00%> (ø)` | |
   | [...rts/src/MixedTimeseries/EchartsMixedTimeseries.tsx](https://codecov.io/gh/apache/superset/pull/23698?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9wbHVnaW4tY2hhcnQtZWNoYXJ0cy9zcmMvTWl4ZWRUaW1lc2VyaWVzL0VjaGFydHNNaXhlZFRpbWVzZXJpZXMudHN4) | `0.00% <0.00%> (ø)` | |
   | [...gin-chart-echarts/src/Sunburst/EchartsSunburst.tsx](https://codecov.io/gh/apache/superset/pull/23698?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9wbHVnaW4tY2hhcnQtZWNoYXJ0cy9zcmMvU3VuYnVyc3QvRWNoYXJ0c1N1bmJ1cnN0LnRzeA==) | `0.00% <0.00%> (ø)` | |
   | [...chart-echarts/src/Timeseries/EchartsTimeseries.tsx](https://codecov.io/gh/apache/superset/pull/23698?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9wbHVnaW4tY2hhcnQtZWNoYXJ0cy9zcmMvVGltZXNlcmllcy9FY2hhcnRzVGltZXNlcmllcy50c3g=) | `0.00% <0.00%> (ø)` | |
   | [...lugin-chart-echarts/src/Treemap/EchartsTreemap.tsx](https://codecov.io/gh/apache/superset/pull/23698?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9wbHVnaW4tY2hhcnQtZWNoYXJ0cy9zcmMvVHJlZW1hcC9FY2hhcnRzVHJlZW1hcC50c3g=) | `0.00% <0.00%> (ø)` | |
   | [...ns/plugin-chart-echarts/src/utils/eventHandlers.ts](https://codecov.io/gh/apache/superset/pull/23698?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9wbHVnaW4tY2hhcnQtZWNoYXJ0cy9zcmMvdXRpbHMvZXZlbnRIYW5kbGVycy50cw==) | `0.00% <0.00%> (ø)` | |
   | ... and [47 more](https://codecov.io/gh/apache/superset/pull/23698?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ... and [86 files with indirect coverage changes](https://codecov.io/gh/apache/superset/pull/23698/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?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