ktmud commented on a change in pull request #10286:
URL: 
https://github.com/apache/incubator-superset/pull/10286#discussion_r452932892



##########
File path: superset/utils/pandas_postprocessing.py
##########
@@ -517,3 +518,29 @@ def _parse_location(location: str) -> Tuple[float, float, 
float]:
         return _append_columns(df, geodetic_df, columns)
     except ValueError:
         raise QueryObjectValidationError(_("Invalid geodetic string"))
+
+
+def contribution(
+    df: DataFrame, orientation: PostProcessingContributionOrientation
+) -> DataFrame:

Review comment:
       Maybe it makes more sense to keep things simple, but is it possible to 
allow specifying which column(s) to compute on? I could imagine this operator 
being used to support "percent metrics" in table charts and it’ll need the 
ability to select specific columns.
   
   Maybe the API can be something like this
   
   ```
   {
     # compute row wise contribution and override the columns
     "columns": ["foo", "bar"],
     "orientation": "row"
   }
   
   {
     # compute column wise computation and insert new columns
     "columns": ["pct_abc"],
     "sources": ["abc"]
   }
   ```




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

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to