Skip to content

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Red Giuliano committed Jan 9, 2025
1 parent 8d2e1f7 commit 93a8dc6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions zt_backend/models/components/html.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ def pygwalker(id: str, df, width: Union[int, str] = '100%', height: Union[int, s
try:
import pandas as pd
import pygwalker as pyg
if not isinstance(df, pd.DataFrame):
raise ValueError("Input must be a pandas DataFrame")

except ImportError as e:
raise ImportError(
"pygwalker or pandas is not installed. Please install with 'pip install pygwalkwer'."
) from e

if not isinstance(df, pd.DataFrame):
raise ValueError("Input must be a pandas DataFrame")


return HTML(id=id, v_html=pyg.to_html(df, width=width, height=height))

0 comments on commit 93a8dc6

Please sign in to comment.