File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 44
55from pptx .enum .text import MSO_VERTICAL_ANCHOR , PP_ALIGN
66from pptx .shapes .graphfrm import GraphicFrame
7+
78from tppt ._features import (
89 USE_PANDAS ,
910 USE_POLARS ,
@@ -152,19 +153,19 @@ def dataframe2list(data: DataFrame) -> list[list[str]]:
152153 if USE_POLARS :
153154 if isinstance (data , PolarsLazyFrame ):
154155 # For LazyFrame, collect it first
155- polars_df = data .collect ()
156+ polars_df = cast ( PolarsLazyFrame , data ) .collect ()
156157 columns = list (polars_df .columns )
157158 rows = polars_df .to_numpy ().tolist ()
158159 return [columns ] + rows
159160 elif isinstance (data , PolarsDataFrame ):
160- polars_df = data
161+ polars_df = cast ( PolarsDataFrame , data )
161162 columns = list (polars_df .columns )
162163 rows = polars_df .to_numpy ().tolist ()
163164 return [columns ] + rows
164165
165166 if USE_PANDAS and isinstance (data , PandasDataFrame ): # type: ignore
166167 # Convert pandas DataFrame to list of lists
167- pandas_df = data
168+ pandas_df = cast ( PandasDataFrame , data )
168169 columns = pandas_df .columns .tolist ()
169170 rows = pandas_df .values .tolist ()
170171 return [columns ] + rows
You can’t perform that action at this time.
0 commit comments