Skip to content

Commit 8741cf0

Browse files
committed
fix: update Pydantic model usage in table conversion and tests
1 parent c63049b commit 8741cf0

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/tppt/pptx/shape/table.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ def dataframe2list(data: DataFrame) -> list[list[str]]:
203203
return [columns] + rows
204204
# Convert list of Pydantic model instances to list of lists
205205
elif USE_PYDANTIC and isinstance(first_instance, PydanticModel):
206-
columns = list(first_instance.__class__.model_fields.keys())
206+
columns = list(first_instance.__class__.model_fields.keys()) # type: ignore
207207
rows = []
208208
for instance in data:
209209
instance = cast(Any, instance)

tests/test_table.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
from dataclasses import dataclass
55

66
import pytest
7-
from pydantic import BaseModel
87

98
import tppt
109
from tppt._features import (
@@ -195,7 +194,7 @@ class Employee:
195194
def test_create_table_with_pydantic_model(output: pathlib.Path) -> None:
196195
"""Test creating a table with Pydantic model."""
197196

198-
class Product(BaseModel):
197+
class Product(PydanticModel):
199198
"""Product model for testing."""
200199

201200
name: str

0 commit comments

Comments
 (0)