Skip to content

Commit 850d79e

Browse files
martinsteinmsullivan
authored andcommitted
Fix default type for Numeric columns to Decimal (#132)
1 parent 3a376f9 commit 850d79e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

sqlalchemy-stubs/sql/sqltypes.pyi

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ class SmallInteger(Integer):
7878
class BigInteger(Integer):
7979
__visit_name__: str = ...
8080

81-
class Numeric(_LookupExpressionAdapter, TypeEngine[float]): # TODO: this can be also decimal.Decimal
81+
# TODO: This can also be float (however, decimal is the default)
82+
class Numeric(_LookupExpressionAdapter, TypeEngine[decimal.Decimal]):
8283
__visit_name__: str = ...
8384
precision: Optional[int] = ...
8485
scale: Optional[int] = ...
@@ -90,7 +91,7 @@ class Numeric(_LookupExpressionAdapter, TypeEngine[float]): # TODO: this can be
9091
def literal_processor(self, dialect: Dialect) -> Callable[[Union[float, decimal.Decimal]], str]: ...
9192
@property
9293
def python_type(self) -> Union[Type[float], Type[decimal.Decimal]]: ... # type: ignore # return type incompatible
93-
def bind_processor(self, dialect: Dialect) -> Optional[Callable[[Optional[str]], float]]: ...
94+
def bind_processor(self, dialect: Dialect) -> Optional[Callable[[Optional[str]], decimal.Decimal]]: ...
9495
def result_processor(self, dialect: Dialect, coltype: Any) -> Optional[Callable[[Optional[Any]],
9596
Optional[Union[float, decimal.Decimal]]]]: ...
9697

0 commit comments

Comments
 (0)