Skip to content

Commit b8c3121

Browse files
authored
🐛 Exclude columns before checking their Python type (tiangolo#5)
1 parent 89ef10a commit b8c3121

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pydantic_sqlalchemy/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ def sqlalchemy_to_pydantic(
1717
for attr in mapper.attrs:
1818
if isinstance(attr, ColumnProperty):
1919
if attr.columns:
20-
column = attr.columns[0]
21-
python_type = column.type.python_type
2220
name = attr.key
2321
if name in exclude:
2422
continue
23+
column = attr.columns[0]
24+
python_type = column.type.python_type
2525
default = None
2626
if column.default is None and not column.nullable:
2727
default = ...

0 commit comments

Comments
 (0)