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 2020/01/02 19:04:22 UTC

[GitHub] [incubator-superset] dpgaspar commented on a change in pull request #8912: Moving appbuilder.xxx out of view files and into app.py

dpgaspar commented on a change in pull request #8912: Moving appbuilder.xxx out of view files and into app.py
URL: https://github.com/apache/incubator-superset/pull/8912#discussion_r362589463
 
 

 ##########
 File path: superset/app.py
 ##########
 @@ -114,10 +116,318 @@ def __call__(self, *args, **kwargs):
 
         celery_app.Task = AppContextTask
 
-    @staticmethod
-    def init_views() -> None:
-        # TODO - This should iterate over all views and register them with FAB...
-        from superset import views  # noqa pylint: disable=unused-variable
+    def init_views(self) -> None:
+        #
+        # We're doing local imports, as several of them import models which in turn try to import
+        # the global Flask app
+        #
+        from superset.connectors.druid.views import (
 
 Review comment:
   I would prefer if possible, to split this. For example on dashboards create a `DashboardManager` that would implement an init_views, then main `app.py` would invoke `init_views` for each manager.
   
   So each package would be responsible for orderly adding what it implements.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

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