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



##########
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:
       The thought did occur to me. In this iteration I wanted to add 
functionality to get feature parity with `viz.py`, but I look forward to adding 
this optionality later. One significant feature that's currently missing is 
being able to get feedback from the operation on what happened, e.g. for pivots 
getting a list of all newly created columns. I have a basic idea of what this 
could look like, but didn't want to get into that before I actually need it.
   
   FYI, this feature was added to create a line chart with similar features as 
the legacy one on `viz.py`. In this case I'm chaining two operations together: 
first a pivot, then a contribution if that option is selected. As I currently 
don't know what come out of the pivot, I'm unable to tell the contribution 
operation which columns it should be processing on. Hence I'm just assuming 
that we're calculating on all columns except the temporal one.




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