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/10/29 13:46:33 UTC

[GitHub] [superset] kgabryje opened a new pull request #17287: fix(dashboard): Return columns and verbose_map for groupby values of Pivot Table v2

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


   ### SUMMARY
   Columns used by Pivot Table v2 were not processed correctly by `/dashboard/{id}/datasets` endpoint, resulting in chart not displaying custom column labels when added to dashboard. This PR fixes the issue.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   Before:
   ![image](https://user-images.githubusercontent.com/15073128/139445984-64578d17-6809-43ad-a54f-0d55f43e5cee.png)
   
   After:
   ![image](https://user-images.githubusercontent.com/15073128/139445573-f4beddbb-1628-400a-a97a-2001a1a4fd42.png)
   
   
   ### TESTING INSTRUCTIONS
   1. Create a pivot table v2 chart using columns with custom labels
   2. Add the chart to dashboard
   3. Verify that custom labels are used instead of column_names
   
   ### 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
   
   CC @junlincc 


-- 
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 #17287: fix(dashboard): Return columns and verbose_map for groupby values of Pivot Table v2

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


   # [Codecov](https://codecov.io/gh/apache/superset/pull/17287?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 [#17287](https://codecov.io/gh/apache/superset/pull/17287?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (097225d) into [master](https://codecov.io/gh/apache/superset/commit/f0c0ef70483ca8f45c9a15d8fd774cb37f7f95e3?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (f0c0ef7) will **decrease** coverage by `0.22%`.
   > The diff coverage is `n/a`.
   
   > :exclamation: Current head 097225d differs from pull request most recent head eb55f31. Consider uploading reports for the commit eb55f31 to get more accurate results
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/17287/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/17287?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   #17287      +/-   ##
   ==========================================
   - Coverage   77.04%   76.82%   -0.23%     
   ==========================================
     Files        1037     1037              
     Lines       55635    55635              
     Branches     7594     7594              
   ==========================================
   - Hits        42863    42739     -124     
   - Misses      12522    12646     +124     
     Partials      250      250              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `?` | |
   | mysql | `81.97% <ø> (ø)` | |
   | postgres | `81.97% <ø> (-0.02%)` | :arrow_down: |
   | presto | `?` | |
   | python | `82.05% <ø> (-0.43%)` | :arrow_down: |
   | sqlite | `81.66% <ø> (ø)` | |
   
   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/17287?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [superset/connectors/base/models.py](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQvY29ubmVjdG9ycy9iYXNlL21vZGVscy5weQ==) | `88.25% <ø> (ø)` | |
   | [superset/db\_engines/hive.py](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-85.19%)` | :arrow_down: |
   | [superset/db\_engine\_specs/hive.py](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2hpdmUucHk=) | `69.76% <0.00%> (-17.06%)` | :arrow_down: |
   | [superset/db\_engine\_specs/presto.py](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3ByZXN0by5weQ==) | `83.47% <0.00%> (-6.91%)` | :arrow_down: |
   | [superset/reports/commands/log\_prune.py](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQvcmVwb3J0cy9jb21tYW5kcy9sb2dfcHJ1bmUucHk=) | `85.71% <0.00%> (-3.58%)` | :arrow_down: |
   | [superset/commands/importers/v1/utils.py](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQvY29tbWFuZHMvaW1wb3J0ZXJzL3YxL3V0aWxzLnB5) | `89.13% <0.00%> (-2.18%)` | :arrow_down: |
   | [superset/views/database/mixins.py](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQvdmlld3MvZGF0YWJhc2UvbWl4aW5zLnB5) | `81.03% <0.00%> (-1.73%)` | :arrow_down: |
   | [superset/connectors/sqla/models.py](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQvY29ubmVjdG9ycy9zcWxhL21vZGVscy5weQ==) | `85.76% <0.00%> (-1.64%)` | :arrow_down: |
   | [superset/models/core.py](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQvbW9kZWxzL2NvcmUucHk=) | `89.26% <0.00%> (-0.74%)` | :arrow_down: |
   | [superset/db\_engine\_specs/base.py](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2Jhc2UucHk=) | `88.20% <0.00%> (-0.39%)` | :arrow_down: |
   | ... and [2 more](https://codecov.io/gh/apache/superset/pull/17287/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/17287?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/17287?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 [f0c0ef7...eb55f31](https://codecov.io/gh/apache/superset/pull/17287?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] kgabryje commented on pull request #17287: fix(dashboard): Return columns and verbose_map for groupby values of Pivot Table v2 [ID-7]

Posted by GitBox <gi...@apache.org>.
kgabryje commented on pull request #17287:
URL: https://github.com/apache/superset/pull/17287#issuecomment-961910680






-- 
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 #17287: fix(dashboard): Return columns and verbose_map for groupby values of Pivot Table v2 [ID-7]

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



##########
File path: superset/connectors/base/models.py
##########
@@ -317,11 +317,23 @@ def data_for_slices(self, slices: List[Slice]) -> Dict[str, Any]:
                 if "column" in filter_config
             )
 
-            column_names.update(
-                column
-                for column_param in COLUMN_FORM_DATA_PARAMS
-                for column in utils.get_iterable(form_data.get(column_param) or [])
-            )
+            # legacy charts don't have query_context charts
+            if slc.query_context:
+                query_context = slc.get_query_context()
+                column_names.update(
+                    [
+                        column
+                        for query in query_context.get("queries", [])
+                        for column in query.get("columns", [])
+                    ]
+                    or []
+                )
+            else:
+                column_names.update(
+                    column
+                    for column_param in COLUMN_FORM_DATA_PARAMS
+                    for column in utils.get_iterable(form_data.get(column_param) or [])
+                )

Review comment:
       Thanks for the explanation. I understood.

##########
File path: superset/models/slice.py
##########
@@ -247,6 +247,17 @@ def form_data(self) -> Dict[str, Any]:
         update_time_range(form_data)
         return form_data
 
+    def get_query_context(self) -> Dict[str, Any]:
+        query_context: Dict[str, Any] = {}
+        if not self.query_context:
+            return query_context
+        try:
+            query_context = json.loads(self.query_context)
+        except json.decoder.JSONDecodeError as ex:
+            logger.error("Malformed json in slice's query context", exc_info=True)
+            logger.exception(ex)
+        return query_context
+

Review comment:
       We can make this function more generic. like this:
   
   ```Python
       def get_query_context(self) -> QueryContext:
           if self.query_context:
               try:
                   return self.query_context(**json.loads(self.query_context))
               except json.decoder.JSONDecodeError as ex:
                   logger.error("Malformed json in slice's query context", exc_info=True)
                   logger.exception(ex)
           return QueryContext(
                          datasource={"type": self.datasource_type, "id": self.datasource_id},
                          queries=[self.viz.query_obj()],)
   ```

##########
File path: superset/models/slice.py
##########
@@ -247,6 +247,17 @@ def form_data(self) -> Dict[str, Any]:
         update_time_range(form_data)
         return form_data
 
+    def get_query_context(self) -> Dict[str, Any]:
+        query_context: Dict[str, Any] = {}
+        if not self.query_context:
+            return query_context
+        try:
+            query_context = json.loads(self.query_context)
+        except json.decoder.JSONDecodeError as ex:
+            logger.error("Malformed json in slice's query context", exc_info=True)
+            logger.exception(ex)
+        return query_context
+

Review comment:
       Nice! It makes sense return `None` in legacy chart.

##########
File path: superset/connectors/base/models.py
##########
@@ -317,11 +317,23 @@ def data_for_slices(self, slices: List[Slice]) -> Dict[str, Any]:
                 if "column" in filter_config
             )
 
-            column_names.update(
-                column
-                for column_param in COLUMN_FORM_DATA_PARAMS
-                for column in utils.get_iterable(form_data.get(column_param) or [])
-            )
+            # legacy charts don't have query_context charts
+            if slc.query_context:
+                query_context = slc.get_query_context()
+                column_names.update(
+                    [
+                        column
+                        for query in query_context.get("queries", [])
+                        for column in query.get("columns", [])
+                    ]
+                    or []
+                )
+            else:
+                column_names.update(
+                    column
+                    for column_param in COLUMN_FORM_DATA_PARAMS
+                    for column in utils.get_iterable(form_data.get(column_param) or [])
+                )

Review comment:
       Thanks for the explanation. I understood.

##########
File path: superset/models/slice.py
##########
@@ -247,6 +247,17 @@ def form_data(self) -> Dict[str, Any]:
         update_time_range(form_data)
         return form_data
 
+    def get_query_context(self) -> Dict[str, Any]:
+        query_context: Dict[str, Any] = {}
+        if not self.query_context:
+            return query_context
+        try:
+            query_context = json.loads(self.query_context)
+        except json.decoder.JSONDecodeError as ex:
+            logger.error("Malformed json in slice's query context", exc_info=True)
+            logger.exception(ex)
+        return query_context
+

Review comment:
       We can make this function more generic. like this:
   
   ```Python
       def get_query_context(self) -> QueryContext:
           if self.query_context:
               try:
                   return self.query_context(**json.loads(self.query_context))
               except json.decoder.JSONDecodeError as ex:
                   logger.error("Malformed json in slice's query context", exc_info=True)
                   logger.exception(ex)
           return QueryContext(
                          datasource={"type": self.datasource_type, "id": self.datasource_id},
                          queries=[self.viz.query_obj()],)
   ```

##########
File path: superset/models/slice.py
##########
@@ -247,6 +247,17 @@ def form_data(self) -> Dict[str, Any]:
         update_time_range(form_data)
         return form_data
 
+    def get_query_context(self) -> Dict[str, Any]:
+        query_context: Dict[str, Any] = {}
+        if not self.query_context:
+            return query_context
+        try:
+            query_context = json.loads(self.query_context)
+        except json.decoder.JSONDecodeError as ex:
+            logger.error("Malformed json in slice's query context", exc_info=True)
+            logger.exception(ex)
+        return query_context
+

Review comment:
       Nice! It makes sense return `None` in legacy chart.




-- 
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 #17287: fix(dashboard): Return columns and verbose_map for groupby values of Pivot Table v2 [ID-7]

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


   


-- 
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] edited a comment on pull request #17287: fix(dashboard): Return columns and verbose_map for groupby values of Pivot Table v2 [ID-7]

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #17287:
URL: https://github.com/apache/superset/pull/17287#issuecomment-954775877


   # [Codecov](https://codecov.io/gh/apache/superset/pull/17287?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 [#17287](https://codecov.io/gh/apache/superset/pull/17287?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (097225d) into [master](https://codecov.io/gh/apache/superset/commit/f0c0ef70483ca8f45c9a15d8fd774cb37f7f95e3?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (f0c0ef7) will **decrease** coverage by `0.21%`.
   > The diff coverage is `n/a`.
   
   > :exclamation: Current head 097225d differs from pull request most recent head 1eb8558. Consider uploading reports for the commit 1eb8558 to get more accurate results
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/17287/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/17287?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   #17287      +/-   ##
   ==========================================
   - Coverage   77.04%   76.82%   -0.22%     
   ==========================================
     Files        1037     1037              
     Lines       55635    55635              
     Branches     7594     7594              
   ==========================================
   - Hits        42863    42742     -121     
   - Misses      12522    12643     +121     
     Partials      250      250              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `?` | |
   | mysql | `81.97% <ø> (ø)` | |
   | postgres | `81.98% <ø> (ø)` | |
   | presto | `?` | |
   | python | `82.06% <ø> (-0.42%)` | :arrow_down: |
   | sqlite | `81.66% <ø> (ø)` | |
   
   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/17287?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [superset/connectors/base/models.py](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQvY29ubmVjdG9ycy9iYXNlL21vZGVscy5weQ==) | `88.25% <ø> (ø)` | |
   | [superset/db\_engines/hive.py](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-85.19%)` | :arrow_down: |
   | [superset/db\_engine\_specs/hive.py](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2hpdmUucHk=) | `69.76% <0.00%> (-17.06%)` | :arrow_down: |
   | [superset/db\_engine\_specs/presto.py](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3ByZXN0by5weQ==) | `83.47% <0.00%> (-6.91%)` | :arrow_down: |
   | [superset/views/database/mixins.py](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQvdmlld3MvZGF0YWJhc2UvbWl4aW5zLnB5) | `81.03% <0.00%> (-1.73%)` | :arrow_down: |
   | [superset/connectors/sqla/models.py](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQvY29ubmVjdG9ycy9zcWxhL21vZGVscy5weQ==) | `85.76% <0.00%> (-1.64%)` | :arrow_down: |
   | [superset/models/core.py](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQvbW9kZWxzL2NvcmUucHk=) | `89.26% <0.00%> (-0.74%)` | :arrow_down: |
   | [superset/db\_engine\_specs/base.py](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2Jhc2UucHk=) | `88.20% <0.00%> (-0.39%)` | :arrow_down: |
   | [superset/utils/core.py](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQvdXRpbHMvY29yZS5weQ==) | `90.02% <0.00%> (-0.12%)` | :arrow_down: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/17287?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/17287?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 [f0c0ef7...1eb8558](https://codecov.io/gh/apache/superset/pull/17287?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] kgabryje commented on pull request #17287: fix(dashboard): Return columns and verbose_map for groupby values of Pivot Table v2 [ID-7]

Posted by GitBox <gi...@apache.org>.
kgabryje commented on pull request #17287:
URL: https://github.com/apache/superset/pull/17287#issuecomment-961910680


   /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] codecov[bot] edited a comment on pull request #17287: fix(dashboard): Return columns and verbose_map for groupby values of Pivot Table v2 [ID-7]

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #17287:
URL: https://github.com/apache/superset/pull/17287#issuecomment-954775877


   # [Codecov](https://codecov.io/gh/apache/superset/pull/17287?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 [#17287](https://codecov.io/gh/apache/superset/pull/17287?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (097225d) into [master](https://codecov.io/gh/apache/superset/commit/f0c0ef70483ca8f45c9a15d8fd774cb37f7f95e3?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (f0c0ef7) will **decrease** coverage by `0.21%`.
   > The diff coverage is `n/a`.
   
   > :exclamation: Current head 097225d differs from pull request most recent head 9045548. Consider uploading reports for the commit 9045548 to get more accurate results
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/17287/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/17287?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   #17287      +/-   ##
   ==========================================
   - Coverage   77.04%   76.82%   -0.22%     
   ==========================================
     Files        1037     1037              
     Lines       55635    55635              
     Branches     7594     7594              
   ==========================================
   - Hits        42863    42742     -121     
   - Misses      12522    12643     +121     
     Partials      250      250              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `?` | |
   | mysql | `81.97% <ø> (ø)` | |
   | postgres | `81.98% <ø> (ø)` | |
   | presto | `?` | |
   | python | `82.06% <ø> (-0.42%)` | :arrow_down: |
   | sqlite | `81.66% <ø> (ø)` | |
   
   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/17287?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [superset/connectors/base/models.py](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQvY29ubmVjdG9ycy9iYXNlL21vZGVscy5weQ==) | `88.25% <ø> (ø)` | |
   | [superset/db\_engines/hive.py](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-85.19%)` | :arrow_down: |
   | [superset/db\_engine\_specs/hive.py](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2hpdmUucHk=) | `69.76% <0.00%> (-17.06%)` | :arrow_down: |
   | [superset/db\_engine\_specs/presto.py](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3ByZXN0by5weQ==) | `83.47% <0.00%> (-6.91%)` | :arrow_down: |
   | [superset/views/database/mixins.py](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQvdmlld3MvZGF0YWJhc2UvbWl4aW5zLnB5) | `81.03% <0.00%> (-1.73%)` | :arrow_down: |
   | [superset/connectors/sqla/models.py](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQvY29ubmVjdG9ycy9zcWxhL21vZGVscy5weQ==) | `85.76% <0.00%> (-1.64%)` | :arrow_down: |
   | [superset/models/core.py](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQvbW9kZWxzL2NvcmUucHk=) | `89.26% <0.00%> (-0.74%)` | :arrow_down: |
   | [superset/db\_engine\_specs/base.py](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2Jhc2UucHk=) | `88.20% <0.00%> (-0.39%)` | :arrow_down: |
   | [superset/utils/core.py](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQvdXRpbHMvY29yZS5weQ==) | `90.02% <0.00%> (-0.12%)` | :arrow_down: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/17287?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/17287?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 [f0c0ef7...9045548](https://codecov.io/gh/apache/superset/pull/17287?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 #17287: fix(dashboard): Return columns and verbose_map for groupby values of Pivot Table v2 [ID-7]

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


   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] kgabryje merged pull request #17287: fix(dashboard): Return columns and verbose_map for groupby values of Pivot Table v2 [ID-7]

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


   


-- 
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] edited a comment on pull request #17287: fix(dashboard): Return columns and verbose_map for groupby values of Pivot Table v2

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #17287:
URL: https://github.com/apache/superset/pull/17287#issuecomment-954775877


   # [Codecov](https://codecov.io/gh/apache/superset/pull/17287?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 [#17287](https://codecov.io/gh/apache/superset/pull/17287?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (097225d) into [master](https://codecov.io/gh/apache/superset/commit/f0c0ef70483ca8f45c9a15d8fd774cb37f7f95e3?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (f0c0ef7) will **decrease** coverage by `0.21%`.
   > The diff coverage is `n/a`.
   
   > :exclamation: Current head 097225d differs from pull request most recent head eb55f31. Consider uploading reports for the commit eb55f31 to get more accurate results
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/17287/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/17287?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   #17287      +/-   ##
   ==========================================
   - Coverage   77.04%   76.82%   -0.22%     
   ==========================================
     Files        1037     1037              
     Lines       55635    55635              
     Branches     7594     7594              
   ==========================================
   - Hits        42863    42742     -121     
   - Misses      12522    12643     +121     
     Partials      250      250              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `?` | |
   | mysql | `81.97% <ø> (ø)` | |
   | postgres | `81.98% <ø> (ø)` | |
   | presto | `?` | |
   | python | `82.06% <ø> (-0.42%)` | :arrow_down: |
   | sqlite | `81.66% <ø> (ø)` | |
   
   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/17287?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [superset/connectors/base/models.py](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQvY29ubmVjdG9ycy9iYXNlL21vZGVscy5weQ==) | `88.25% <ø> (ø)` | |
   | [superset/db\_engines/hive.py](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-85.19%)` | :arrow_down: |
   | [superset/db\_engine\_specs/hive.py](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2hpdmUucHk=) | `69.76% <0.00%> (-17.06%)` | :arrow_down: |
   | [superset/db\_engine\_specs/presto.py](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3ByZXN0by5weQ==) | `83.47% <0.00%> (-6.91%)` | :arrow_down: |
   | [superset/views/database/mixins.py](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQvdmlld3MvZGF0YWJhc2UvbWl4aW5zLnB5) | `81.03% <0.00%> (-1.73%)` | :arrow_down: |
   | [superset/connectors/sqla/models.py](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQvY29ubmVjdG9ycy9zcWxhL21vZGVscy5weQ==) | `85.76% <0.00%> (-1.64%)` | :arrow_down: |
   | [superset/models/core.py](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQvbW9kZWxzL2NvcmUucHk=) | `89.26% <0.00%> (-0.74%)` | :arrow_down: |
   | [superset/db\_engine\_specs/base.py](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2Jhc2UucHk=) | `88.20% <0.00%> (-0.39%)` | :arrow_down: |
   | [superset/utils/core.py](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQvdXRpbHMvY29yZS5weQ==) | `90.02% <0.00%> (-0.12%)` | :arrow_down: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/17287?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/17287?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 [f0c0ef7...eb55f31](https://codecov.io/gh/apache/superset/pull/17287?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] zhaoyongjie commented on a change in pull request #17287: fix(dashboard): Return columns and verbose_map for groupby values of Pivot Table v2 [ID-7]

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



##########
File path: superset/models/slice.py
##########
@@ -247,6 +247,17 @@ def form_data(self) -> Dict[str, Any]:
         update_time_range(form_data)
         return form_data
 
+    def get_query_context(self) -> Dict[str, Any]:
+        query_context: Dict[str, Any] = {}
+        if not self.query_context:
+            return query_context
+        try:
+            query_context = json.loads(self.query_context)
+        except json.decoder.JSONDecodeError as ex:
+            logger.error("Malformed json in slice's query context", exc_info=True)
+            logger.exception(ex)
+        return query_context
+

Review comment:
       Nice! It makes sense return `None` in legacy chart.




-- 
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 #17287: fix(dashboard): Return columns and verbose_map for groupby values of Pivot Table v2 [ID-7]

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






-- 
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] edited a comment on pull request #17287: fix(dashboard): Return columns and verbose_map for groupby values of Pivot Table v2

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #17287:
URL: https://github.com/apache/superset/pull/17287#issuecomment-954775877


   # [Codecov](https://codecov.io/gh/apache/superset/pull/17287?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 [#17287](https://codecov.io/gh/apache/superset/pull/17287?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (097225d) into [master](https://codecov.io/gh/apache/superset/commit/f0c0ef70483ca8f45c9a15d8fd774cb37f7f95e3?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (f0c0ef7) will **decrease** coverage by `0.21%`.
   > The diff coverage is `n/a`.
   
   > :exclamation: Current head 097225d differs from pull request most recent head 8ff4836. Consider uploading reports for the commit 8ff4836 to get more accurate results
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/17287/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/17287?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   #17287      +/-   ##
   ==========================================
   - Coverage   77.04%   76.82%   -0.22%     
   ==========================================
     Files        1037     1037              
     Lines       55635    55635              
     Branches     7594     7594              
   ==========================================
   - Hits        42863    42742     -121     
   - Misses      12522    12643     +121     
     Partials      250      250              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `?` | |
   | mysql | `81.97% <ø> (ø)` | |
   | postgres | `81.98% <ø> (ø)` | |
   | presto | `?` | |
   | python | `82.06% <ø> (-0.42%)` | :arrow_down: |
   | sqlite | `81.66% <ø> (ø)` | |
   
   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/17287?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [superset/connectors/base/models.py](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQvY29ubmVjdG9ycy9iYXNlL21vZGVscy5weQ==) | `88.25% <ø> (ø)` | |
   | [superset/db\_engines/hive.py](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-85.19%)` | :arrow_down: |
   | [superset/db\_engine\_specs/hive.py](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2hpdmUucHk=) | `69.76% <0.00%> (-17.06%)` | :arrow_down: |
   | [superset/db\_engine\_specs/presto.py](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3ByZXN0by5weQ==) | `83.47% <0.00%> (-6.91%)` | :arrow_down: |
   | [superset/views/database/mixins.py](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQvdmlld3MvZGF0YWJhc2UvbWl4aW5zLnB5) | `81.03% <0.00%> (-1.73%)` | :arrow_down: |
   | [superset/connectors/sqla/models.py](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQvY29ubmVjdG9ycy9zcWxhL21vZGVscy5weQ==) | `85.76% <0.00%> (-1.64%)` | :arrow_down: |
   | [superset/models/core.py](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQvbW9kZWxzL2NvcmUucHk=) | `89.26% <0.00%> (-0.74%)` | :arrow_down: |
   | [superset/db\_engine\_specs/base.py](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2Jhc2UucHk=) | `88.20% <0.00%> (-0.39%)` | :arrow_down: |
   | [superset/utils/core.py](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQvdXRpbHMvY29yZS5weQ==) | `90.02% <0.00%> (-0.12%)` | :arrow_down: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/17287?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/17287?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 [f0c0ef7...8ff4836](https://codecov.io/gh/apache/superset/pull/17287?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] codecov[bot] edited a comment on pull request #17287: fix(dashboard): Return columns and verbose_map for groupby values of Pivot Table v2 [ID-7]

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #17287:
URL: https://github.com/apache/superset/pull/17287#issuecomment-954775877


   # [Codecov](https://codecov.io/gh/apache/superset/pull/17287?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 [#17287](https://codecov.io/gh/apache/superset/pull/17287?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (097225d) into [master](https://codecov.io/gh/apache/superset/commit/f0c0ef70483ca8f45c9a15d8fd774cb37f7f95e3?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (f0c0ef7) will **decrease** coverage by `0.21%`.
   > The diff coverage is `n/a`.
   
   > :exclamation: Current head 097225d differs from pull request most recent head 9b42b69. Consider uploading reports for the commit 9b42b69 to get more accurate results
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/17287/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/17287?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   #17287      +/-   ##
   ==========================================
   - Coverage   77.04%   76.82%   -0.22%     
   ==========================================
     Files        1037     1037              
     Lines       55635    55635              
     Branches     7594     7594              
   ==========================================
   - Hits        42863    42742     -121     
   - Misses      12522    12643     +121     
     Partials      250      250              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `?` | |
   | mysql | `81.97% <ø> (ø)` | |
   | postgres | `81.98% <ø> (ø)` | |
   | presto | `?` | |
   | python | `82.06% <ø> (-0.42%)` | :arrow_down: |
   | sqlite | `81.66% <ø> (ø)` | |
   
   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/17287?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [superset/connectors/base/models.py](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQvY29ubmVjdG9ycy9iYXNlL21vZGVscy5weQ==) | `88.25% <ø> (ø)` | |
   | [superset/db\_engines/hive.py](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-85.19%)` | :arrow_down: |
   | [superset/db\_engine\_specs/hive.py](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2hpdmUucHk=) | `69.76% <0.00%> (-17.06%)` | :arrow_down: |
   | [superset/db\_engine\_specs/presto.py](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3ByZXN0by5weQ==) | `83.47% <0.00%> (-6.91%)` | :arrow_down: |
   | [superset/views/database/mixins.py](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQvdmlld3MvZGF0YWJhc2UvbWl4aW5zLnB5) | `81.03% <0.00%> (-1.73%)` | :arrow_down: |
   | [superset/connectors/sqla/models.py](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQvY29ubmVjdG9ycy9zcWxhL21vZGVscy5weQ==) | `85.76% <0.00%> (-1.64%)` | :arrow_down: |
   | [superset/models/core.py](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQvbW9kZWxzL2NvcmUucHk=) | `89.26% <0.00%> (-0.74%)` | :arrow_down: |
   | [superset/db\_engine\_specs/base.py](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2Jhc2UucHk=) | `88.20% <0.00%> (-0.39%)` | :arrow_down: |
   | [superset/utils/core.py](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQvdXRpbHMvY29yZS5weQ==) | `90.02% <0.00%> (-0.12%)` | :arrow_down: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/17287?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/17287?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 [f0c0ef7...9b42b69](https://codecov.io/gh/apache/superset/pull/17287?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] kgabryje commented on a change in pull request #17287: fix(dashboard): Return columns and verbose_map for groupby values of Pivot Table v2 [ID-7]

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



##########
File path: superset/models/slice.py
##########
@@ -247,6 +247,17 @@ def form_data(self) -> Dict[str, Any]:
         update_time_range(form_data)
         return form_data
 
+    def get_query_context(self) -> Dict[str, Any]:
+        query_context: Dict[str, Any] = {}
+        if not self.query_context:
+            return query_context
+        try:
+            query_context = json.loads(self.query_context)
+        except json.decoder.JSONDecodeError as ex:
+            logger.error("Malformed json in slice's query context", exc_info=True)
+            logger.exception(ex)
+        return query_context
+

Review comment:
       Thanks for suggestions! I made the change, would appreciate another look 🙂 




-- 
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 #17287: fix(dashboard): Return columns and verbose_map for groupby values of Pivot Table v2 [ID-7]

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



##########
File path: superset/models/slice.py
##########
@@ -247,6 +247,17 @@ def form_data(self) -> Dict[str, Any]:
         update_time_range(form_data)
         return form_data
 
+    def get_query_context(self) -> Dict[str, Any]:
+        query_context: Dict[str, Any] = {}
+        if not self.query_context:
+            return query_context
+        try:
+            query_context = json.loads(self.query_context)
+        except json.decoder.JSONDecodeError as ex:
+            logger.error("Malformed json in slice's query context", exc_info=True)
+            logger.exception(ex)
+        return query_context
+

Review comment:
       We can make this function more generic. like this:
   
   ```Python
       def get_query_context(self) -> QueryContext:
           if self.query_context:
               try:
                   return self.query_context(**json.loads(self.query_context))
               except json.decoder.JSONDecodeError as ex:
                   logger.error("Malformed json in slice's query context", exc_info=True)
                   logger.exception(ex)
           return QueryContext(
                          datasource={"type": self.datasource_type, "id": self.datasource_id},
                          queries=[self.viz.query_obj()],)
   ```




-- 
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 #17287: fix(dashboard): Return columns and verbose_map for groupby values of Pivot Table v2 [ID-7]

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



##########
File path: superset/connectors/base/models.py
##########
@@ -317,11 +317,23 @@ def data_for_slices(self, slices: List[Slice]) -> Dict[str, Any]:
                 if "column" in filter_config
             )
 
-            column_names.update(
-                column
-                for column_param in COLUMN_FORM_DATA_PARAMS
-                for column in utils.get_iterable(form_data.get(column_param) or [])
-            )
+            # legacy charts don't have query_context charts
+            if slc.query_context:
+                query_context = slc.get_query_context()
+                column_names.update(
+                    [
+                        column
+                        for query in query_context.get("queries", [])
+                        for column in query.get("columns", [])
+                    ]
+                    or []
+                )
+            else:
+                column_names.update(
+                    column
+                    for column_param in COLUMN_FORM_DATA_PARAMS
+                    for column in utils.get_iterable(form_data.get(column_param) or [])
+                )

Review comment:
       I think just add `groupbyColumns` and `groupbyRows` into COLUMN_FORM_DATA_PARAMS
   
   ````
   COLUMN_FORM_DATA_PARAMS = [
       "all_columns",
       "all_columns_x",
       "columns",
       "entity",
       "groupby",
       "order_by_cols",
       "series",
       "groupbyColumns",
       "groupbyRows",
   ]
   ```
   




-- 
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] edited a comment on pull request #17287: fix(dashboard): Return columns and verbose_map for groupby values of Pivot Table v2 [ID-7]

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #17287:
URL: https://github.com/apache/superset/pull/17287#issuecomment-954775877






-- 
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 #17287: fix(dashboard): Return columns and verbose_map for groupby values of Pivot Table v2 [ID-7]

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



##########
File path: superset/models/slice.py
##########
@@ -247,6 +247,17 @@ def form_data(self) -> Dict[str, Any]:
         update_time_range(form_data)
         return form_data
 
+    def get_query_context(self) -> Dict[str, Any]:
+        query_context: Dict[str, Any] = {}
+        if not self.query_context:
+            return query_context
+        try:
+            query_context = json.loads(self.query_context)
+        except json.decoder.JSONDecodeError as ex:
+            logger.error("Malformed json in slice's query context", exc_info=True)
+            logger.exception(ex)
+        return query_context
+

Review comment:
       @zhaoyongjie on the first return statement I believe we could instantiate the `QueryContext`. Also, for non v1 charts or in the case there isn't a query context payload, we probably should just return `None`, as the legacy charts aren't really compatible with `QueryContext`. Could this work?
   ```python
       def get_query_context(self) -> Optional[QueryContext]:
           if self.query_context:
               try:
                   return QueryContext(**json.loads(self.query_context))
               except json.decoder.JSONDecodeError as ex:
                   logger.error("Malformed json in slice's query context", exc_info=True)
                   logger.exception(ex)
           return None
   ```




-- 
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 #17287: fix(dashboard): Return columns and verbose_map for groupby values of Pivot Table v2 [ID-7]

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



##########
File path: superset/connectors/base/models.py
##########
@@ -317,11 +317,23 @@ def data_for_slices(self, slices: List[Slice]) -> Dict[str, Any]:
                 if "column" in filter_config
             )
 
-            column_names.update(
-                column
-                for column_param in COLUMN_FORM_DATA_PARAMS
-                for column in utils.get_iterable(form_data.get(column_param) or [])
-            )
+            # legacy charts don't have query_context charts
+            if slc.query_context:
+                query_context = slc.get_query_context()
+                column_names.update(
+                    [
+                        column
+                        for query in query_context.get("queries", [])
+                        for column in query.get("columns", [])
+                    ]
+                    or []
+                )
+            else:
+                column_names.update(
+                    column
+                    for column_param in COLUMN_FORM_DATA_PARAMS
+                    for column in utils.get_iterable(form_data.get(column_param) or [])
+                )

Review comment:
       Thanks for the explanation. I understood.




-- 
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 #17287: fix(dashboard): Return columns and verbose_map for groupby values of Pivot Table v2 [ID-7]

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



##########
File path: superset/models/slice.py
##########
@@ -247,6 +247,17 @@ def form_data(self) -> Dict[str, Any]:
         update_time_range(form_data)
         return form_data
 
+    def get_query_context(self) -> Dict[str, Any]:
+        query_context: Dict[str, Any] = {}
+        if not self.query_context:
+            return query_context
+        try:
+            query_context = json.loads(self.query_context)
+        except json.decoder.JSONDecodeError as ex:
+            logger.error("Malformed json in slice's query context", exc_info=True)
+            logger.exception(ex)
+        return query_context
+

Review comment:
       @zhaoyongjie on the first return statement I believe we could instantiate the `QueryContext`. Also, for non v1 charts or in the case there isn't a query context payload, we probably should just return `None`, as the legacy charts aren't really compatible with `QueryContext`. Could this work?
   ```python
       def get_query_context(self) -> Optional[QueryContext]:
           if self.query_context:
               try:
                   return QueryContext(**json.loads(self.query_context))
               except json.decoder.JSONDecodeError as ex:
                   logger.error("Malformed json in slice's query context", exc_info=True)
                   logger.exception(ex)
           return None
   ```




-- 
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 #17287: fix(dashboard): Return columns and verbose_map for groupby values of Pivot Table v2 [ID-7]

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


   @kgabryje Ephemeral environment spinning up at http://54.213.130.117: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] kgabryje merged pull request #17287: fix(dashboard): Return columns and verbose_map for groupby values of Pivot Table v2 [ID-7]

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


   


-- 
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 #17287: fix(dashboard): Return columns and verbose_map for groupby values of Pivot Table v2 [ID-7]

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



##########
File path: superset/models/slice.py
##########
@@ -247,6 +247,17 @@ def form_data(self) -> Dict[str, Any]:
         update_time_range(form_data)
         return form_data
 
+    def get_query_context(self) -> Dict[str, Any]:
+        query_context: Dict[str, Any] = {}
+        if not self.query_context:
+            return query_context
+        try:
+            query_context = json.loads(self.query_context)
+        except json.decoder.JSONDecodeError as ex:
+            logger.error("Malformed json in slice's query context", exc_info=True)
+            logger.exception(ex)
+        return query_context
+

Review comment:
       @zhaoyongjie on the first return statement I believe we could instantiate the `QueryContext`. Also, for non v1 charts or in the case there isn't a query context payload, we probably should just return `None`, as the legacy charts aren't really compatible with `QueryContext`. Could this work?
   ```python
       def get_query_context(self) -> Optional[QueryContext]:
           if self.query_context:
               try:
                   return QueryContext(**json.loads(self.query_context))
               except json.decoder.JSONDecodeError as ex:
                   logger.error("Malformed json in slice's query context", exc_info=True)
                   logger.exception(ex)
           return None
   ```




-- 
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] sadpandajoe commented on pull request #17287: fix(dashboard): Return columns and verbose_map for groupby values of Pivot Table v2 [ID-7]

Posted by GitBox <gi...@apache.org>.
sadpandajoe commented on pull request #17287:
URL: https://github.com/apache/superset/pull/17287#issuecomment-970938703


   🏷️ 2021.46


-- 
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 #17287: fix(dashboard): Return columns and verbose_map for groupby values of Pivot Table v2 [ID-7]

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



##########
File path: superset/connectors/base/models.py
##########
@@ -317,11 +317,23 @@ def data_for_slices(self, slices: List[Slice]) -> Dict[str, Any]:
                 if "column" in filter_config
             )
 
-            column_names.update(
-                column
-                for column_param in COLUMN_FORM_DATA_PARAMS
-                for column in utils.get_iterable(form_data.get(column_param) or [])
-            )
+            # legacy charts don't have query_context charts
+            if slc.query_context:
+                query_context = slc.get_query_context()
+                column_names.update(
+                    [
+                        column
+                        for query in query_context.get("queries", [])
+                        for column in query.get("columns", [])
+                    ]
+                    or []
+                )
+            else:
+                column_names.update(
+                    column
+                    for column_param in COLUMN_FORM_DATA_PARAMS
+                    for column in utils.get_iterable(form_data.get(column_param) or [])
+                )

Review comment:
       That was actually my first solution 😄 But @villebro suggested that I use columns in query_context instead, so that the solution is more generic and future proof - if in the future we add another chart that uses different field names in form data for columns, this solution will handle it correctly

##########
File path: superset/models/slice.py
##########
@@ -247,6 +247,17 @@ def form_data(self) -> Dict[str, Any]:
         update_time_range(form_data)
         return form_data
 
+    def get_query_context(self) -> Dict[str, Any]:
+        query_context: Dict[str, Any] = {}
+        if not self.query_context:
+            return query_context
+        try:
+            query_context = json.loads(self.query_context)
+        except json.decoder.JSONDecodeError as ex:
+            logger.error("Malformed json in slice's query context", exc_info=True)
+            logger.exception(ex)
+        return query_context
+

Review comment:
       Thanks for suggestions! I made the change, would appreciate another look 🙂 

##########
File path: superset/models/slice.py
##########
@@ -247,6 +247,17 @@ def form_data(self) -> Dict[str, Any]:
         update_time_range(form_data)
         return form_data
 
+    def get_query_context(self) -> Dict[str, Any]:
+        query_context: Dict[str, Any] = {}
+        if not self.query_context:
+            return query_context
+        try:
+            query_context = json.loads(self.query_context)
+        except json.decoder.JSONDecodeError as ex:
+            logger.error("Malformed json in slice's query context", exc_info=True)
+            logger.exception(ex)
+        return query_context
+

Review comment:
       Thanks for suggestions! I made the change, would appreciate another look 🙂 




-- 
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] edited a comment on pull request #17287: fix(dashboard): Return columns and verbose_map for groupby values of Pivot Table v2 [ID-7]

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #17287:
URL: https://github.com/apache/superset/pull/17287#issuecomment-954775877


   # [Codecov](https://codecov.io/gh/apache/superset/pull/17287?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 [#17287](https://codecov.io/gh/apache/superset/pull/17287?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (fa2cf5a) into [master](https://codecov.io/gh/apache/superset/commit/f0c0ef70483ca8f45c9a15d8fd774cb37f7f95e3?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (f0c0ef7) will **decrease** coverage by `0.11%`.
   > The diff coverage is `72.70%`.
   
   > :exclamation: Current head fa2cf5a differs from pull request most recent head 1eb8558. Consider uploading reports for the commit 1eb8558 to get more accurate results
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/17287/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/17287?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   #17287      +/-   ##
   ==========================================
   - Coverage   77.04%   76.92%   -0.12%     
   ==========================================
     Files        1037     1036       -1     
     Lines       55635    55757     +122     
     Branches     7594     7628      +34     
   ==========================================
   + Hits        42863    42891      +28     
   - Misses      12522    12610      +88     
   - Partials      250      256       +6     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `?` | |
   | mysql | `81.90% <67.08%> (-0.07%)` | :arrow_down: |
   | postgres | `81.91% <67.08%> (-0.07%)` | :arrow_down: |
   | presto | `?` | |
   | python | `82.00% <67.08%> (-0.49%)` | :arrow_down: |
   | sqlite | `81.59% <67.08%> (-0.07%)` | :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/17287?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [superset-frontend/src/chart/Chart.jsx](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NoYXJ0L0NoYXJ0LmpzeA==) | `43.33% <ø> (ø)` | |
   | [superset-frontend/src/chart/ChartRenderer.jsx](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NoYXJ0L0NoYXJ0UmVuZGVyZXIuanN4) | `36.70% <0.00%> (-0.48%)` | :arrow_down: |
   | [...t-frontend/src/components/AsyncAceEditor/index.tsx](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvQXN5bmNBY2VFZGl0b3IvaW5kZXgudHN4) | `88.00% <ø> (-0.47%)` | :arrow_down: |
   | [superset-frontend/src/dashboard/actions/hydrate.js](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9hY3Rpb25zL2h5ZHJhdGUuanM=) | `1.70% <0.00%> (ø)` | |
   | [.../src/dashboard/components/gridComponents/Chart.jsx](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL2dyaWRDb21wb25lbnRzL0NoYXJ0LmpzeA==) | `80.37% <ø> (ø)` | |
   | [...perset-frontend/src/explore/components/Control.tsx](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9Db250cm9sLnRzeA==) | `72.22% <0.00%> (-4.25%)` | :arrow_down: |
   | [...ntend/src/explore/components/ExploreChartPanel.jsx](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9FeHBsb3JlQ2hhcnRQYW5lbC5qc3g=) | `14.28% <ø> (ø)` | |
   | [...nd/src/explore/components/ExploreViewContainer.jsx](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9FeHBsb3JlVmlld0NvbnRhaW5lci5qc3g=) | `2.11% <ø> (ø)` | |
   | [...rc/explore/components/controls/TextAreaControl.jsx](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9UZXh0QXJlYUNvbnRyb2wuanN4) | `91.66% <ø> (+9.31%)` | :arrow_up: |
   | [...-frontend/src/explore/components/controls/index.js](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9pbmRleC5qcw==) | `100.00% <ø> (ø)` | |
   | ... and [90 more](https://codecov.io/gh/apache/superset/pull/17287/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/17287?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/17287?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 [f0c0ef7...1eb8558](https://codecov.io/gh/apache/superset/pull/17287?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] codecov[bot] edited a comment on pull request #17287: fix(dashboard): Return columns and verbose_map for groupby values of Pivot Table v2 [ID-7]

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #17287:
URL: https://github.com/apache/superset/pull/17287#issuecomment-954775877


   # [Codecov](https://codecov.io/gh/apache/superset/pull/17287?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 [#17287](https://codecov.io/gh/apache/superset/pull/17287?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (fa2cf5a) into [master](https://codecov.io/gh/apache/superset/commit/f0c0ef70483ca8f45c9a15d8fd774cb37f7f95e3?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (f0c0ef7) will **decrease** coverage by `0.11%`.
   > The diff coverage is `72.70%`.
   
   > :exclamation: Current head fa2cf5a differs from pull request most recent head 6695113. Consider uploading reports for the commit 6695113 to get more accurate results
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/17287/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/17287?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   #17287      +/-   ##
   ==========================================
   - Coverage   77.04%   76.92%   -0.12%     
   ==========================================
     Files        1037     1036       -1     
     Lines       55635    55757     +122     
     Branches     7594     7628      +34     
   ==========================================
   + Hits        42863    42891      +28     
   - Misses      12522    12610      +88     
   - Partials      250      256       +6     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `?` | |
   | mysql | `81.90% <67.08%> (-0.07%)` | :arrow_down: |
   | postgres | `81.91% <67.08%> (-0.07%)` | :arrow_down: |
   | presto | `?` | |
   | python | `82.00% <67.08%> (-0.49%)` | :arrow_down: |
   | sqlite | `81.59% <67.08%> (-0.07%)` | :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/17287?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [superset-frontend/src/chart/Chart.jsx](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NoYXJ0L0NoYXJ0LmpzeA==) | `43.33% <ø> (ø)` | |
   | [superset-frontend/src/chart/ChartRenderer.jsx](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NoYXJ0L0NoYXJ0UmVuZGVyZXIuanN4) | `36.70% <0.00%> (-0.48%)` | :arrow_down: |
   | [...t-frontend/src/components/AsyncAceEditor/index.tsx](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvQXN5bmNBY2VFZGl0b3IvaW5kZXgudHN4) | `88.00% <ø> (-0.47%)` | :arrow_down: |
   | [superset-frontend/src/dashboard/actions/hydrate.js](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9hY3Rpb25zL2h5ZHJhdGUuanM=) | `1.70% <0.00%> (ø)` | |
   | [.../src/dashboard/components/gridComponents/Chart.jsx](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL2dyaWRDb21wb25lbnRzL0NoYXJ0LmpzeA==) | `80.37% <ø> (ø)` | |
   | [...perset-frontend/src/explore/components/Control.tsx](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9Db250cm9sLnRzeA==) | `72.22% <0.00%> (-4.25%)` | :arrow_down: |
   | [...ntend/src/explore/components/ExploreChartPanel.jsx](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9FeHBsb3JlQ2hhcnRQYW5lbC5qc3g=) | `14.28% <ø> (ø)` | |
   | [...nd/src/explore/components/ExploreViewContainer.jsx](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9FeHBsb3JlVmlld0NvbnRhaW5lci5qc3g=) | `2.11% <ø> (ø)` | |
   | [...rc/explore/components/controls/TextAreaControl.jsx](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9UZXh0QXJlYUNvbnRyb2wuanN4) | `91.66% <ø> (+9.31%)` | :arrow_up: |
   | [...-frontend/src/explore/components/controls/index.js](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9pbmRleC5qcw==) | `100.00% <ø> (ø)` | |
   | ... and [90 more](https://codecov.io/gh/apache/superset/pull/17287/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/17287?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/17287?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 [f0c0ef7...6695113](https://codecov.io/gh/apache/superset/pull/17287?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 #17287: fix(dashboard): Return columns and verbose_map for groupby values of Pivot Table v2 [ID-7]

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






-- 
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] edited a comment on pull request #17287: fix(dashboard): Return columns and verbose_map for groupby values of Pivot Table v2 [ID-7]

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #17287:
URL: https://github.com/apache/superset/pull/17287#issuecomment-954775877


   # [Codecov](https://codecov.io/gh/apache/superset/pull/17287?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 [#17287](https://codecov.io/gh/apache/superset/pull/17287?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (6695113) into [master](https://codecov.io/gh/apache/superset/commit/f0c0ef70483ca8f45c9a15d8fd774cb37f7f95e3?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (f0c0ef7) will **decrease** coverage by `0.24%`.
   > The diff coverage is `75.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/17287/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/17287?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   #17287      +/-   ##
   ==========================================
   - Coverage   77.04%   76.80%   -0.25%     
   ==========================================
     Files        1037     1037              
     Lines       55635    55718      +83     
     Branches     7594     7594              
   ==========================================
   - Hits        42863    42792      -71     
   - Misses      12522    12676     +154     
     Partials      250      250              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `?` | |
   | mysql | `81.90% <75.00%> (-0.07%)` | :arrow_down: |
   | postgres | `81.91% <75.00%> (-0.07%)` | :arrow_down: |
   | presto | `?` | |
   | python | `82.00% <75.00%> (-0.49%)` | :arrow_down: |
   | sqlite | `81.59% <75.00%> (-0.07%)` | :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/17287?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [superset/models/slice.py](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQvbW9kZWxzL3NsaWNlLnB5) | `85.05% <60.00%> (-1.37%)` | :arrow_down: |
   | [superset/connectors/base/models.py](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQvY29ubmVjdG9ycy9iYXNlL21vZGVscy5weQ==) | `88.36% <100.00%> (+0.11%)` | :arrow_up: |
   | [superset/examples/birth\_names.py](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQvZXhhbXBsZXMvYmlydGhfbmFtZXMucHk=) | `71.02% <100.00%> (-2.76%)` | :arrow_down: |
   | [superset/db\_engines/hive.py](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-85.19%)` | :arrow_down: |
   | [superset/db\_engine\_specs/hive.py](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2hpdmUucHk=) | `69.76% <0.00%> (-17.06%)` | :arrow_down: |
   | [superset/db\_engine\_specs/presto.py](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3ByZXN0by5weQ==) | `83.47% <0.00%> (-6.91%)` | :arrow_down: |
   | [superset/views/dashboard/views.py](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQvdmlld3MvZGFzaGJvYXJkL3ZpZXdzLnB5) | `68.91% <0.00%> (-4.06%)` | :arrow_down: |
   | [superset/datasets/dao.py](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQvZGF0YXNldHMvZGFvLnB5) | `93.70% <0.00%> (-2.80%)` | :arrow_down: |
   | [superset/examples/paris.py](https://codecov.io/gh/apache/superset/pull/17287/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-c3VwZXJzZXQvZXhhbXBsZXMvcGFyaXMucHk=) | `25.00% <0.00%> (-1.93%)` | :arrow_down: |
   | ... and [32 more](https://codecov.io/gh/apache/superset/pull/17287/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/17287?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/17287?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 [f0c0ef7...6695113](https://codecov.io/gh/apache/superset/pull/17287?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] kgabryje commented on a change in pull request #17287: fix(dashboard): Return columns and verbose_map for groupby values of Pivot Table v2 [ID-7]

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



##########
File path: superset/connectors/base/models.py
##########
@@ -317,11 +317,23 @@ def data_for_slices(self, slices: List[Slice]) -> Dict[str, Any]:
                 if "column" in filter_config
             )
 
-            column_names.update(
-                column
-                for column_param in COLUMN_FORM_DATA_PARAMS
-                for column in utils.get_iterable(form_data.get(column_param) or [])
-            )
+            # legacy charts don't have query_context charts
+            if slc.query_context:
+                query_context = slc.get_query_context()
+                column_names.update(
+                    [
+                        column
+                        for query in query_context.get("queries", [])
+                        for column in query.get("columns", [])
+                    ]
+                    or []
+                )
+            else:
+                column_names.update(
+                    column
+                    for column_param in COLUMN_FORM_DATA_PARAMS
+                    for column in utils.get_iterable(form_data.get(column_param) or [])
+                )

Review comment:
       That was actually my first solution 😄 But @villebro suggested that I use columns in query_context instead, so that the solution is more generic and future proof - if in the future we add another chart that uses different field names in form data for columns, this solution will handle it correctly




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