Skip to content

Commit ed47f74

Browse files
committed
cleaner type name format
1 parent 5c170bf commit ed47f74

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/sqlacodegen/generators.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1255,10 +1255,8 @@ def render_python_type(column_type: TypeEngine[Any]) -> str:
12551255
self.add_import(Any)
12561256
python_type = Any
12571257

1258-
python_type_name = (
1259-
python_type.__name__
1260-
if hasattr(python_type, "__name__")
1261-
else python_type._name
1258+
python_type_name = cast(
1259+
str, getattr(python_type, "__name__", python_type._name)
12621260
)
12631261
python_type_module = python_type.__module__
12641262
if python_type_module == "builtins":

0 commit comments

Comments
 (0)