From 714d8512c771271032d8e0897dc7537d68b8eccb Mon Sep 17 00:00:00 2001 From: Lingyi Zhang Date: Thu, 13 Jun 2024 01:57:03 -0400 Subject: [PATCH] linting --- .../dashboard/graph/code_generation.py | 3 ++- .../dashboard/nodes/core_builder/build.py | 5 ----- .../dashboard/nodes/core_builder/model.py | 1 - .../nodes/core_builder/vizro_ai_db.py | 20 ------------------- 4 files changed, 2 insertions(+), 27 deletions(-) delete mode 100644 vizro-ai/src/vizro_ai/dashboard/nodes/core_builder/vizro_ai_db.py diff --git a/vizro-ai/src/vizro_ai/dashboard/graph/code_generation.py b/vizro-ai/src/vizro_ai/dashboard/graph/code_generation.py index fb6ff457d..a14862b0c 100644 --- a/vizro-ai/src/vizro_ai/dashboard/graph/code_generation.py +++ b/vizro-ai/src/vizro_ai/dashboard/graph/code_generation.py @@ -5,7 +5,8 @@ from typing import Any, Dict, List import pandas as pd -from langchain.globals import set_debug + +# from langchain.globals import set_debug from langgraph.graph import END, StateGraph from vizro.models import Dashboard from vizro_ai.chains._llm_models import _get_llm_model diff --git a/vizro-ai/src/vizro_ai/dashboard/nodes/core_builder/build.py b/vizro-ai/src/vizro_ai/dashboard/nodes/core_builder/build.py index 9a0e67901..5c69163e4 100644 --- a/vizro-ai/src/vizro_ai/dashboard/nodes/core_builder/build.py +++ b/vizro-ai/src/vizro_ai/dashboard/nodes/core_builder/build.py @@ -49,7 +49,6 @@ def _build_components(self): ) return components - @property def layout(self): """Property to get layout.""" @@ -57,7 +56,6 @@ def layout(self): self._layout = self._build_layout() return self._layout - def _build_layout(self): logger.info(f"Building layout: {self._page_plan}") return self._page_plan.layout.create(model=self._model, df_metadata=self._df_metadata) @@ -81,13 +79,10 @@ def _build_controls(self): ): control = self._page_plan.controls.controls[i].create( model=self._model, available_components=self.available_components, df_metadata=self._df_metadata - ) - model=self._model, available_components=self.available_components, df_metadata=self._df_metadata ) if control: controls.append(control) - return controls @property diff --git a/vizro-ai/src/vizro_ai/dashboard/nodes/core_builder/model.py b/vizro-ai/src/vizro_ai/dashboard/nodes/core_builder/model.py index 01ae2b8a8..ad358a34f 100644 --- a/vizro-ai/src/vizro_ai/dashboard/nodes/core_builder/model.py +++ b/vizro-ai/src/vizro_ai/dashboard/nodes/core_builder/model.py @@ -9,7 +9,6 @@ from langchain_core.prompts import ChatPromptTemplate - class ProxyVizroBaseModel(BaseModel): """Proxy model for VizroBaseModel.""" diff --git a/vizro-ai/src/vizro_ai/dashboard/nodes/core_builder/vizro_ai_db.py b/vizro-ai/src/vizro_ai/dashboard/nodes/core_builder/vizro_ai_db.py deleted file mode 100644 index 6bba180df..000000000 --- a/vizro-ai/src/vizro_ai/dashboard/nodes/core_builder/vizro_ai_db.py +++ /dev/null @@ -1,20 +0,0 @@ -from typing import Dict - -from .build import DashboardBuilder -from .plan import _get_dashboard_plan, _print_dashboard_plan - - -class VizroAIDashboard: - def __init__(self, model): - self.model = model - self.dashboard_plan = None - - def _build_dashboard(self, query: str, df_metadata: Dict[str, Dict[str, str]]): - self.dashboard_plan = _get_dashboard_plan(query=query, model=self.model, df_metadata=df_metadata) - _print_dashboard_plan(self.dashboard_plan) - dashboard = DashboardBuilder( - model=self.model, - df_metadata=df_metadata, - dashboard_plan=self.dashboard_plan, - ).dashboard - return dashboard