Antonio-RiveroMartnez commented on code in PR #33656:
URL: https://github.com/apache/superset/pull/33656#discussion_r2126947350


##########
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:
   Looking at the `buildQuery` this is something to be computed by 
`query_object -> exe_post_processing`. I don't  think we should bring these 
into the context processor which is a more abstract concept. Meaning, these 
changes would be introducing an implementation that's very specific for your 
use case into something that's broadly used across the app.
   
   Is there a way to include your new post processor without affecting the 
context? how is the current one working without having to alter it?



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

Review Comment:
   Is there a way we can make the function not raise 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