Error when adding or removing a report to/from a Dashboard
When I try to add a report to a Dashboard I get an error.
This error does not affect the functionality of Meltano Analyze:
- The reports are added to the dashboards
- You can see the reports when you go to the dashboard's page
- When you click
Edit
on the report in the Dashboard page, you get the correct report
Where this happens
A Meltano Analyze Page, e.g.:
http://localhost:5000/analyze/model-facebook/facebook/fb_funnel_performance_per_day
How to reproduce
-
Click
Add to Dashboard
--> Click on an existing Dashboard --> Error -
Click
Add to Dashboard
-->Create Dashboard
--> Save --> Error when report is added to the Dashboard -
Click
Add to Dashboard
--> Click on an already selected Dashboard to unselect it --> Error
This happens when you try to add a report to a new dashboard or an existing dashboard, but also when you remove a report from a dashboard.
Even though this error is raised, the dashboard is created without issues (if a new dashboard is selected) and the report is properly saved to the Dashboard
Error
ERROR:flask.app:Exception on /api/v1/dashboards/dashboard/reports [POST]
Traceback (most recent call last):
File "/Users/iroussos/work/meltano/venv/lib/python3.7/site-packages/flask/app.py", line 2292, in wsgi_app
response = self.full_dispatch_request()
File "/Users/iroussos/work/meltano/venv/lib/python3.7/site-packages/flask/app.py", line 1815, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/Users/iroussos/work/meltano/venv/lib/python3.7/site-packages/flask_restful/__init__.py", line 269, in error_router
return original_handler(e)
File "/Users/iroussos/work/meltano/venv/lib/python3.7/site-packages/flask/app.py", line 1718, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/Users/iroussos/work/meltano/venv/lib/python3.7/site-packages/flask/_compat.py", line 35, in reraise
raise value
File "/Users/iroussos/work/meltano/venv/lib/python3.7/site-packages/flask/app.py", line 1813, in full_dispatch_request
rv = self.dispatch_request()
File "/Users/iroussos/work/meltano/venv/lib/python3.7/site-packages/flask/app.py", line 1799, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/Users/iroussos/work/meltano/src/meltano/api/controllers/dashboards.py", line 140, in get_dashboard_reports_with_query_results
post_data
File "/Users/iroussos/work/meltano/src/meltano/api/controllers/dashboards_helper.py", line 20, in get_dashboard_reports_with_query_results
m5oc = sqlHelper.get_m5oc_topic(report["namespace"], report["model"])
TypeError: 'NoneType' object is not subscriptable
TODO
-
refactor activeDashboardReports
as computed -
ensure reports
is updated in real-time