john-bodley commented on a change in pull request #9912:
URL: 
https://github.com/apache/incubator-superset/pull/9912#discussion_r431271053



##########
File path: superset/views/chart/views.py
##########
@@ -40,22 +41,22 @@ class SliceModelView(
         RouteMethod.API_DELETE,
     }
 
-    def pre_add(self, item):
+    def pre_add(self, item: "SliceModelView") -> None:
         utils.validate_json(item.params)
 
-    def pre_update(self, item):
+    def pre_update(self, item: "SliceModelView") -> None:
         utils.validate_json(item.params)
         check_ownership(item)
 
-    def pre_delete(self, item):
+    def pre_delete(self, item: "SliceModelView") -> None:
         check_ownership(item)
 
     @expose("/add", methods=["GET", "POST"])
     @has_access
-    def add(self):
-        datasources = ConnectorRegistry.get_all_datasources(db.session)
+    def add(self) -> FlaskResponse:
         datasources = [
-            {"value": str(d.id) + "__" + d.type, "label": repr(d)} for d in 
datasources
+            {"value": str(d.id) + "__" + str(d.type), "label": repr(d)}

Review comment:
       Thanks for the suggestion @villebro. I think in the long term these 
abstract base classes should use 
[ABC](https://docs.python.org/3/library/abc.html) or similar and definitely not 
set defaults like they have.




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