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/07/30 12:16:16 UTC

[GitHub] [superset] zhaoyongjie commented on a change in pull request #15975: fix: eliminate cartesian product columns in pivot operator

zhaoyongjie commented on a change in pull request #15975:
URL: https://github.com/apache/superset/pull/15975#discussion_r679878804



##########
File path: tests/integration_tests/pandas_postprocessing_tests.py
##########
@@ -256,6 +257,29 @@ def test_pivot_exceptions(self):
             aggregates={"idx_nulls": {}},
         )
 
+    def test_pivot_eliminate_cartesian_product_columns(self):
+        mock_df = DataFrame(
+            {
+                "dttm": to_datetime(["2019-01-01", "2019-01-01"]),
+                "a": [0, 1],
+                "b": [0, 1],
+                "metric": [9, np.NAN],
+            }
+        )
+
+        df = proc.pivot(
+            df=mock_df,
+            index=["dttm"],
+            columns=["a", "b"],
+            aggregates={"metric": {"operator": "mean"}},
+            drop_missing_columns=False,
+        )
+        print(df)

Review comment:
       LOL.....




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