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 2022/07/06 18:19:33 UTC

[GitHub] [superset] betodealmeida commented on a diff in pull request #20629: fix: pandas bug when data is blank on post-processing

betodealmeida commented on code in PR #20629:
URL: https://github.com/apache/superset/pull/20629#discussion_r915131543


##########
superset/charts/post_processing.py:
##########
@@ -325,9 +325,16 @@ def apply_post_process(
 
     for query in result["queries"]:
         if query["result_format"] == ChartDataResultFormat.JSON:
-            df = pd.DataFrame.from_dict(query["data"])
+            try:
+                df = pd.DataFrame.from_dict(query["data"])
+            except ValueError:  # no data error
+                return result

Review Comment:
   I think it would be better to `continue` here and in line 336, since other queries might have data (and if they also don't we'll end up returning `result` unmodified).



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