Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jul 11, 2024
1 parent c99c9c2 commit 69df6e0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
2 changes: 1 addition & 1 deletion vizro-ai/src/vizro_ai/dashboard/graph/code_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def _store_df_info(state: GraphState, config: RunnableConfig) -> Dict[str, DfMet
cleaned_df_name = re.sub(r"\W+", "_", cleaned_df_name)
df_id = cleaned_df_name.strip("_")
logger.info(f"df_name: {df_name} --> df_id: {df_id}")
df_metadata[df_id] = {"df_schema": df_schema, "df": df} # TODO: shall be a dataclass
df_metadata[df_id] = {"df_schema": df_schema, "df": df} # TODO: shall be a dataclass

return {"df_metadata": df_metadata}

Expand Down
13 changes: 4 additions & 9 deletions vizro-ai/src/vizro_ai/dashboard/nodes/plan.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,7 @@ class Component(BaseModel):
component_id: str = Field(
pattern=r"^[a-z]+(_[a-z]+)?$", description="Small snake case description of this component."
)
page_id: str = Field(
...,
description="The page id where this component will be placed."
)
page_id: str = Field(..., description="The page id where this component will be placed.")
data_frame: str = Field(
...,
description="The name of the dataframe that this component will use. If the dataframe is "
Expand All @@ -62,13 +59,11 @@ def create(self, model, df_metadata) -> Union[ComponentType, None]:

if self.component_type == "Graph":
return vm.Graph(
id=self.component_id+"_"+self.page_id,
figure=vizro_ai.plot(df=df_metadata[self.data_frame]["df"], user_input=self.component_description)
id=self.component_id + "_" + self.page_id,
figure=vizro_ai.plot(df=df_metadata[self.data_frame]["df"], user_input=self.component_description),
)
elif self.component_type == "AgGrid":
return vm.AgGrid(
id=self.component_id+"_"+self.page_id,
figure=dash_ag_grid(data_frame=self.data_frame))
return vm.AgGrid(id=self.component_id + "_" + self.page_id, figure=dash_ag_grid(data_frame=self.data_frame))
elif self.component_type == "Card":
return _get_proxy_model(
query=self.component_description, llm_model=model, result_model=vm.Card, df_metadata=df_metadata
Expand Down
1 change: 1 addition & 0 deletions vizro-ai/src/vizro_ai/dashboard/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

# import black
from typing import Any

import tqdm.std
import vizro.models as vm

Expand Down

0 comments on commit 69df6e0

Please sign in to comment.