-
Notifications
You must be signed in to change notification settings - Fork 14.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Moving appbuilder.xxx out of view files and into app.py #8912
Conversation
# 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 ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Absolutely makes sense. I would like to do that as another step, however. This change will let us move in that direction as it removes some of the side effects that exist in the current setup. At some point, I'll pull relevant pieces out into their own "configuration" classes which will do just what you said - break things up and allow for a bit more composability. I'd also like to update the CLI WRT these changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There will be a fair amount of view shuffling as we break down and reorg modules. First goal is to move view init out of module scope, then find the right home for each view and init call. This is a good step in the right direction.
Codecov Report
@@ Coverage Diff @@
## master #8912 +/- ##
=======================================
Coverage 58.97% 58.97%
=======================================
Files 359 359
Lines 11333 11333
Branches 2787 2787
=======================================
Hits 6684 6684
Misses 4471 4471
Partials 178 178 Continue to review full report at Codecov.
|
# Conflicts: # superset/views/dashboard/api.py # superset/views/log/api.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
CATEGORY
Choose one
SUMMARY
This is a follow-up to #8418
appbuilder.add_view
/appbuilder.add_link
/ etc. from view files intoapp.py
REVIEWERS
@dpgaspar @mistercrunch