LevisNgigi commented on code in PR #33656:
URL: https://github.com/apache/superset/pull/33656#discussion_r2127001916


##########
superset/common/query_context_processor.py:
##########
@@ -741,24 +741,77 @@ def get_data(
 
         return df.to_dict(orient="records")
 
-    def get_payload(
+    def get_payload(  # noqa: C901
         self,
         cache_query_context: bool | None = False,
         force_cached: bool = False,
     ) -> dict[str, Any]:
         """Returns the query results with both metadata and data"""
+        # Handle empty queries case
+        if not self._query_context.queries:

Review Comment:
   Thank you for the review,the current 'contribution' post-processing step 
computes percentages based on the data already in the DataFrame (i.e. totals 
are computed from the same dataset and no external input needed).
   
   Therefore, no external data (like auxiliary totals) needs to be injected in 
the context layer. The whole computation happens inside contribution(df, ...) 
at post-processing time.But for this we need the totals from the dataset to be 
able to calculate percentage based on all records not just the row limit,so 
trying to look for another way to do this.



-- 
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: [email protected]

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