Skip to content

Commit 75657b7

Browse files
committed
add warning about fallback
1 parent 74daca7 commit 75657b7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/sqlacodegen/generators.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from __future__ import annotations
22

33
import inspect
4+
import logging
45
import re
56
import sys
67
from abc import ABCMeta, abstractmethod
@@ -65,6 +66,8 @@
6566
uses_default_name,
6667
)
6768

69+
_logger = logging.getLogger(__name__)
70+
6871
_re_boolean_check_constraint = re.compile(r"(?:.*?\.)?(.*?) IN \(0, 1\)")
6972
_re_column_name = re.compile(r'(?:(["`]?).*\1\.)?(["`]?)(.*)\2')
7073
_re_enum_check_constraint = re.compile(r"(?:.*?\.)?(.*?) IN \((.+)\)")
@@ -1246,6 +1249,9 @@ def render_python_type(column_type: TypeEngine[Any]) -> str:
12461249
try:
12471250
python_type = column_type.python_type
12481251
except NotImplementedError:
1252+
_logger.warning(
1253+
f"Unable to determine python type for {column_type}, falling back to typing.Any"
1254+
)
12491255
self.add_literal_import("typing", "Any")
12501256
python_type = Any
12511257

0 commit comments

Comments
 (0)