Skip to content

Commit ea924cf

Browse files
Fix all Plotly API errors and implement comprehensive validation system
Co-authored-by: Genovese-Felipe <[email protected]>
1 parent c3494ce commit ea924cf

File tree

10 files changed

+860
-412
lines changed

10 files changed

+860
-412
lines changed

Dashboard_Working.ipynb

Lines changed: 2 additions & 204 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@
360360
" color_discrete_map=colors,\n",
361361
" hover_data=['project_name', 'manager']\n",
362362
" )\n",
363-
" bar_fig.update_xaxis(tickangle=45)\n",
363+
" bar_fig.update_xaxes(tickangle=45)\n",
364364
" bar_fig.update_layout(height=400, title_font_size=16)\n",
365365
" \n",
366366
" # 3. Budget Scatter Plot\n",
@@ -502,208 +502,6 @@
502502
},
503503
"metadata": {},
504504
"output_type": "display_data"
505-
},
506-
{
507-
"name": "stderr",
508-
"output_type": "stream",
509-
"text": [
510-
"[2025-07-29 17:51:06,571] ERROR in app: Exception on /_dash-update-component [POST]\n",
511-
"Traceback (most recent call last):\n",
512-
" File \"/usr/local/python/3.12.1/lib/python3.12/site-packages/flask/app.py\", line 880, in full_dispatch_request\n",
513-
" rv = self.dispatch_request()\n",
514-
" ^^^^^^^^^^^^^^^^^^^^^^^\n",
515-
" File \"/usr/local/python/3.12.1/lib/python3.12/site-packages/flask/app.py\", line 865, in dispatch_request\n",
516-
" return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return]\n",
517-
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n",
518-
" File \"/usr/local/python/3.12.1/lib/python3.12/site-packages/dash/dash.py\", line 1373, in dispatch\n",
519-
" ctx.run(\n",
520-
" File \"/usr/local/python/3.12.1/lib/python3.12/site-packages/dash/_callback.py\", line 465, in add_context\n",
521-
" output_value = _invoke_callback(func, *func_args, **func_kwargs)\n",
522-
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n",
523-
" File \"/usr/local/python/3.12.1/lib/python3.12/site-packages/dash/_callback.py\", line 40, in _invoke_callback\n",
524-
" return func(*args, **kwargs) # %% callback invoked %%\n",
525-
" ^^^^^^^^^^^^^^^^^^^^^\n",
526-
" File \"/tmp/ipykernel_14267/100816639.py\", line 41, in update_charts\n",
527-
" bar_fig.update_xaxis(tickangle=45)\n",
528-
" ^^^^^^^^^^^^^^^^^^^^\n",
529-
"AttributeError: 'Figure' object has no attribute 'update_xaxis'. Did you mean: 'update_xaxes'?\n",
530-
"\n",
531-
"During handling of the above exception, another exception occurred:\n",
532-
"\n",
533-
"Traceback (most recent call last):\n",
534-
" File \"/usr/local/python/3.12.1/lib/python3.12/site-packages/flask/app.py\", line 1473, in wsgi_app\n",
535-
" response = self.full_dispatch_request()\n",
536-
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n",
537-
" File \"/usr/local/python/3.12.1/lib/python3.12/site-packages/flask/app.py\", line 882, in full_dispatch_request\n",
538-
" rv = self.handle_user_exception(e)\n",
539-
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n",
540-
" File \"/usr/local/python/3.12.1/lib/python3.12/site-packages/flask/app.py\", line 772, in handle_user_exception\n",
541-
" return self.ensure_sync(handler)(e) # type: ignore[no-any-return]\n",
542-
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n",
543-
" File \"/usr/local/python/3.12.1/lib/python3.12/site-packages/dash/_jupyter.py\", line 458, in _wrap_errors\n",
544-
" ipytb = FormattedTB(\n",
545-
" ^^^^^^^^^^^^\n",
546-
"TypeError: FormattedTB.__init__() got an unexpected keyword argument 'color_scheme'\n",
547-
"Error on request:\n",
548-
"Traceback (most recent call last):\n",
549-
" File \"/usr/local/python/3.12.1/lib/python3.12/site-packages/flask/app.py\", line 880, in full_dispatch_request\n",
550-
" rv = self.dispatch_request()\n",
551-
" ^^^^^^^^^^^^^^^^^^^^^^^\n",
552-
" File \"/usr/local/python/3.12.1/lib/python3.12/site-packages/flask/app.py\", line 865, in dispatch_request\n",
553-
" return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return]\n",
554-
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n",
555-
" File \"/usr/local/python/3.12.1/lib/python3.12/site-packages/dash/dash.py\", line 1373, in dispatch\n",
556-
" ctx.run(\n",
557-
" File \"/usr/local/python/3.12.1/lib/python3.12/site-packages/dash/_callback.py\", line 465, in add_context\n",
558-
" output_value = _invoke_callback(func, *func_args, **func_kwargs)\n",
559-
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n",
560-
" File \"/usr/local/python/3.12.1/lib/python3.12/site-packages/dash/_callback.py\", line 40, in _invoke_callback\n",
561-
" return func(*args, **kwargs) # %% callback invoked %%\n",
562-
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n",
563-
" File \"/tmp/ipykernel_14267/100816639.py\", line 41, in update_charts\n",
564-
" bar_fig.update_xaxis(tickangle=45)\n",
565-
"AttributeError: 'Figure' object has no attribute 'update_xaxis'. Did you mean: 'update_xaxes'?\n",
566-
"\n",
567-
"During handling of the above exception, another exception occurred:\n",
568-
"\n",
569-
"Traceback (most recent call last):\n",
570-
" File \"/usr/local/python/3.12.1/lib/python3.12/site-packages/flask/app.py\", line 1473, in wsgi_app\n",
571-
" response = self.full_dispatch_request()\n",
572-
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n",
573-
" File \"/usr/local/python/3.12.1/lib/python3.12/site-packages/flask/app.py\", line 882, in full_dispatch_request\n",
574-
" rv = self.handle_user_exception(e)\n",
575-
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n",
576-
" File \"/usr/local/python/3.12.1/lib/python3.12/site-packages/flask/app.py\", line 772, in handle_user_exception\n",
577-
" return self.ensure_sync(handler)(e) # type: ignore[no-any-return]\n",
578-
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n",
579-
" File \"/usr/local/python/3.12.1/lib/python3.12/site-packages/dash/_jupyter.py\", line 458, in _wrap_errors\n",
580-
" ipytb = FormattedTB(\n",
581-
" ^^^^^^^^^^^^\n",
582-
"TypeError: FormattedTB.__init__() got an unexpected keyword argument 'color_scheme'\n",
583-
"\n",
584-
"During handling of the above exception, another exception occurred:\n",
585-
"\n",
586-
"Traceback (most recent call last):\n",
587-
" File \"/usr/local/python/3.12.1/lib/python3.12/site-packages/werkzeug/serving.py\", line 370, in run_wsgi\n",
588-
" execute(self.server.app)\n",
589-
" File \"/usr/local/python/3.12.1/lib/python3.12/site-packages/werkzeug/serving.py\", line 331, in execute\n",
590-
" application_iter = app(environ, start_response)\n",
591-
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n",
592-
" File \"/usr/local/python/3.12.1/lib/python3.12/site-packages/flask/app.py\", line 1498, in __call__\n",
593-
" return self.wsgi_app(environ, start_response)\n",
594-
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n",
595-
" File \"/usr/local/python/3.12.1/lib/python3.12/site-packages/flask/app.py\", line 1476, in wsgi_app\n",
596-
" response = self.handle_exception(e)\n",
597-
" ^^^^^^^^^^^^^^^^^^^^^^^^\n",
598-
" File \"/usr/local/python/3.12.1/lib/python3.12/site-packages/flask/app.py\", line 823, in handle_exception\n",
599-
" server_error = self.ensure_sync(handler)(server_error)\n",
600-
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n",
601-
" File \"/usr/local/python/3.12.1/lib/python3.12/site-packages/dash/_jupyter.py\", line 449, in _wrap_errors\n",
602-
" skip = _get_skip(error) if dev_tools_prune_errors else 0\n",
603-
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n",
604-
" File \"/usr/local/python/3.12.1/lib/python3.12/site-packages/dash/_jupyter.py\", line 45, in _get_skip\n",
605-
" while tb.tb_next is not None:\n",
606-
" ^^^^^^^^^^^^^^^^^^^^^^^\n",
607-
"AttributeError: 'NoneType' object has no attribute 'tb_next'\n",
608-
"[2025-07-29 17:51:29,309] ERROR in app: Exception on /_dash-update-component [POST]\n",
609-
"Traceback (most recent call last):\n",
610-
" File \"/usr/local/python/3.12.1/lib/python3.12/site-packages/flask/app.py\", line 880, in full_dispatch_request\n",
611-
" rv = self.dispatch_request()\n",
612-
" ^^^^^^^^^^^^^^^^^^^^^^^\n",
613-
" File \"/usr/local/python/3.12.1/lib/python3.12/site-packages/flask/app.py\", line 865, in dispatch_request\n",
614-
" return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return]\n",
615-
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n",
616-
" File \"/usr/local/python/3.12.1/lib/python3.12/site-packages/dash/dash.py\", line 1373, in dispatch\n",
617-
" ctx.run(\n",
618-
" File \"/usr/local/python/3.12.1/lib/python3.12/site-packages/dash/_callback.py\", line 465, in add_context\n",
619-
" output_value = _invoke_callback(func, *func_args, **func_kwargs)\n",
620-
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n",
621-
" File \"/usr/local/python/3.12.1/lib/python3.12/site-packages/dash/_callback.py\", line 40, in _invoke_callback\n",
622-
" return func(*args, **kwargs) # %% callback invoked %%\n",
623-
" ^^^^^^^^^^^^^^^^^^^^^\n",
624-
" File \"/tmp/ipykernel_14267/100816639.py\", line 41, in update_charts\n",
625-
" bar_fig.update_xaxis(tickangle=45)\n",
626-
" ^^^^^^^^^^^^^^^^^^^^\n",
627-
"AttributeError: 'Figure' object has no attribute 'update_xaxis'. Did you mean: 'update_xaxes'?\n",
628-
"\n",
629-
"During handling of the above exception, another exception occurred:\n",
630-
"\n",
631-
"Traceback (most recent call last):\n",
632-
" File \"/usr/local/python/3.12.1/lib/python3.12/site-packages/flask/app.py\", line 1473, in wsgi_app\n",
633-
" response = self.full_dispatch_request()\n",
634-
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n",
635-
" File \"/usr/local/python/3.12.1/lib/python3.12/site-packages/flask/app.py\", line 882, in full_dispatch_request\n",
636-
" rv = self.handle_user_exception(e)\n",
637-
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n",
638-
" File \"/usr/local/python/3.12.1/lib/python3.12/site-packages/flask/app.py\", line 772, in handle_user_exception\n",
639-
" return self.ensure_sync(handler)(e) # type: ignore[no-any-return]\n",
640-
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n",
641-
" File \"/usr/local/python/3.12.1/lib/python3.12/site-packages/dash/_jupyter.py\", line 458, in _wrap_errors\n",
642-
" ipytb = FormattedTB(\n",
643-
" ^^^^^^^^^^^^\n",
644-
"TypeError: FormattedTB.__init__() got an unexpected keyword argument 'color_scheme'\n",
645-
"Error on request:\n",
646-
"Traceback (most recent call last):\n",
647-
" File \"/usr/local/python/3.12.1/lib/python3.12/site-packages/flask/app.py\", line 880, in full_dispatch_request\n",
648-
" rv = self.dispatch_request()\n",
649-
" ^^^^^^^^^^^^^^^^^^^^^^^\n",
650-
" File \"/usr/local/python/3.12.1/lib/python3.12/site-packages/flask/app.py\", line 865, in dispatch_request\n",
651-
" return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return]\n",
652-
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n",
653-
" File \"/usr/local/python/3.12.1/lib/python3.12/site-packages/dash/dash.py\", line 1373, in dispatch\n",
654-
" ctx.run(\n",
655-
" File \"/usr/local/python/3.12.1/lib/python3.12/site-packages/dash/_callback.py\", line 465, in add_context\n",
656-
" output_value = _invoke_callback(func, *func_args, **func_kwargs)\n",
657-
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n",
658-
" File \"/usr/local/python/3.12.1/lib/python3.12/site-packages/dash/_callback.py\", line 40, in _invoke_callback\n",
659-
" return func(*args, **kwargs) # %% callback invoked %%\n",
660-
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n",
661-
" File \"/tmp/ipykernel_14267/100816639.py\", line 41, in update_charts\n",
662-
" bar_fig.update_xaxis(tickangle=45)\n",
663-
"AttributeError: 'Figure' object has no attribute 'update_xaxis'. Did you mean: 'update_xaxes'?\n",
664-
"\n",
665-
"During handling of the above exception, another exception occurred:\n",
666-
"\n",
667-
"Traceback (most recent call last):\n",
668-
" File \"/usr/local/python/3.12.1/lib/python3.12/site-packages/flask/app.py\", line 1473, in wsgi_app\n",
669-
" response = self.full_dispatch_request()\n",
670-
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n",
671-
" File \"/usr/local/python/3.12.1/lib/python3.12/site-packages/flask/app.py\", line 882, in full_dispatch_request\n",
672-
" rv = self.handle_user_exception(e)\n",
673-
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n",
674-
" File \"/usr/local/python/3.12.1/lib/python3.12/site-packages/flask/app.py\", line 772, in handle_user_exception\n",
675-
" return self.ensure_sync(handler)(e) # type: ignore[no-any-return]\n",
676-
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n",
677-
" File \"/usr/local/python/3.12.1/lib/python3.12/site-packages/dash/_jupyter.py\", line 458, in _wrap_errors\n",
678-
" ipytb = FormattedTB(\n",
679-
" ^^^^^^^^^^^^\n",
680-
"TypeError: FormattedTB.__init__() got an unexpected keyword argument 'color_scheme'\n",
681-
"\n",
682-
"During handling of the above exception, another exception occurred:\n",
683-
"\n",
684-
"Traceback (most recent call last):\n",
685-
" File \"/usr/local/python/3.12.1/lib/python3.12/site-packages/werkzeug/serving.py\", line 370, in run_wsgi\n",
686-
" execute(self.server.app)\n",
687-
" File \"/usr/local/python/3.12.1/lib/python3.12/site-packages/werkzeug/serving.py\", line 331, in execute\n",
688-
" application_iter = app(environ, start_response)\n",
689-
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n",
690-
" File \"/usr/local/python/3.12.1/lib/python3.12/site-packages/flask/app.py\", line 1498, in __call__\n",
691-
" return self.wsgi_app(environ, start_response)\n",
692-
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n",
693-
" File \"/usr/local/python/3.12.1/lib/python3.12/site-packages/flask/app.py\", line 1476, in wsgi_app\n",
694-
" response = self.handle_exception(e)\n",
695-
" ^^^^^^^^^^^^^^^^^^^^^^^^\n",
696-
" File \"/usr/local/python/3.12.1/lib/python3.12/site-packages/flask/app.py\", line 823, in handle_exception\n",
697-
" server_error = self.ensure_sync(handler)(server_error)\n",
698-
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n",
699-
" File \"/usr/local/python/3.12.1/lib/python3.12/site-packages/dash/_jupyter.py\", line 449, in _wrap_errors\n",
700-
" skip = _get_skip(error) if dev_tools_prune_errors else 0\n",
701-
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n",
702-
" File \"/usr/local/python/3.12.1/lib/python3.12/site-packages/dash/_jupyter.py\", line 45, in _get_skip\n",
703-
" while tb.tb_next is not None:\n",
704-
" ^^^^^^^^^^^^^^^^^^^^^^^\n",
705-
"AttributeError: 'NoneType' object has no attribute 'tb_next'\n"
706-
]
707505
}
708506
],
709507
"source": [
@@ -1096,4 +894,4 @@
1096894
},
1097895
"nbformat": 4,
1098896
"nbformat_minor": 5
1099-
}
897+
}

0 commit comments

Comments
 (0)