eschutho commented on code in PR #24663:
URL: https://github.com/apache/superset/pull/24663#discussion_r1261592279


##########
superset/datasets/schemas.py:
##########
@@ -204,8 +204,13 @@ def fix_extra(self, data: dict[str, Any], **kwargs: Any) 
-> dict[str, Any]:
         """
         Fix for extra initially being exported as a string.
         """
-        if isinstance(data.get("extra"), str):
-            data["extra"] = json.loads(data["extra"])
+        if "extra" in data:
+            extra = data["extra"]
+            if isinstance(extra, str):
+                if extra.strip():
+                    data["extra"] = json.loads(extra)
+                else:
+                    data["extra"] = {}

Review Comment:
   @john-bodley had also suggested that we could try to fix the underlying code 
in order to make the data structures consistent. Unless you're feeling 
ambitious in this PR we could also fix the default in the import to be the 
correct format. I assume it should be an empty dictionary? 



-- 
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-unsubscr...@superset.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org
For additional commands, e-mail: notifications-h...@superset.apache.org

Reply via email to