From 1941993cdd2964b4d9837fa872adb90f35b69db5 Mon Sep 17 00:00:00 2001 From: Lingyi Zhang Date: Fri, 2 Aug 2024 00:02:40 -0400 Subject: [PATCH] remove code from DashboardOutputs --- vizro-ai/src/vizro_ai/_vizro_ai.py | 6 +++--- vizro-ai/src/vizro_ai/dashboard/utils.py | 9 --------- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/vizro-ai/src/vizro_ai/_vizro_ai.py b/vizro-ai/src/vizro_ai/_vizro_ai.py index ec2ffc1e1..61e2dc48b 100644 --- a/vizro-ai/src/vizro_ai/_vizro_ai.py +++ b/vizro-ai/src/vizro_ai/_vizro_ai.py @@ -9,7 +9,7 @@ from vizro_ai._llm_models import _get_llm_model, _get_model_name from vizro_ai.dashboard._graph.dashboard_creation import _create_and_compile_graph -from vizro_ai.dashboard.utils import DashboardOutputs, _dashboard_code, _register_data +from vizro_ai.dashboard.utils import DashboardOutputs, _register_data from vizro_ai.plot.components import GetCodeExplanation, GetDebugger from vizro_ai.plot.task_pipeline._pipeline_manager import PipelineManager from vizro_ai.utils.helper import ( @@ -195,8 +195,8 @@ def dashboard( _register_data(all_df_metadata=message_res["all_df_metadata"]) if return_elements: - code = _dashboard_code(dashboard) # TODO: `_dashboard_code` to be implemented - dashboard_output = DashboardOutputs(dashboard=dashboard, code=code) + # code = _dashboard_code(dashboard) # TODO: `_dashboard_code` to be implemented + dashboard_output = DashboardOutputs(dashboard=dashboard) return dashboard_output else: return dashboard diff --git a/vizro-ai/src/vizro_ai/dashboard/utils.py b/vizro-ai/src/vizro_ai/dashboard/utils.py index 5f7b52fa5..7276a57bb 100644 --- a/vizro-ai/src/vizro_ai/dashboard/utils.py +++ b/vizro-ai/src/vizro_ai/dashboard/utils.py @@ -46,7 +46,6 @@ def get_df_schema(self, name: str) -> Dict[str, str]: class DashboardOutputs: """Dataclass containing all possible `VizroAI.dashboard()` output.""" - code: str dashboard: vm.Dashboard @@ -62,11 +61,3 @@ def _register_data(all_df_metadata: AllDfMetadata) -> vm.Dashboard: for name, metadata in all_df_metadata.all_df_metadata.items(): data_manager[name] = metadata.df - - -def _dashboard_code(dashboard: vm.Dashboard) -> str: - """Generate dashboard code from dashboard object.""" - try: - return dashboard.to_python() - except AttributeError: - return "Dashboard code generation is coming soon!"