ktmud commented on a change in pull request #9284: Reduce dashboard bootstrap
payload
URL:
https://github.com/apache/incubator-superset/pull/9284#discussion_r391315900
##########
File path: superset/views/core.py
##########
@@ -1788,25 +1788,40 @@ def dashboard(self, dashboard_id):
dash = qry.one_or_none()
if not dash:
abort(404)
- datasources = set()
+ datasources = {}
Review comment:
I think this works, does it?
```python
datasources = defaultdict(lambda: { "slices": [] })
for slc in dash.slices:
datasource = slc.datasource
if slc:
datasources[datasource.uid]["datasource"] = datasource
datasources[datasource.uid]["slices"].append(slc)
```
Or you can use `datasource` itself as the key
```python
datasources = defaultdict(list)
for slc in dash.slices:
if slc.datasource:
datasources[slc.datasource].append(scl)
```
would need to update future loops accordingly.
----------------------------------------------------------------
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]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]