Skip to content

Fix default type for Numeric columns to Decimal #132

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 16, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions sqlalchemy-stubs/sql/sqltypes.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ class SmallInteger(Integer):
class BigInteger(Integer):
__visit_name__: str = ...

class Numeric(_LookupExpressionAdapter, TypeEngine[float]): # TODO: this can be also decimal.Decimal
# TODO: This can also be float (however, decimal is the default)
class Numeric(_LookupExpressionAdapter, TypeEngine[decimal.Decimal]):
__visit_name__: str = ...
precision: Optional[int] = ...
scale: Optional[int] = ...
Expand All @@ -90,7 +91,7 @@ class Numeric(_LookupExpressionAdapter, TypeEngine[float]): # TODO: this can be
def literal_processor(self, dialect: Dialect) -> Callable[[Union[float, decimal.Decimal]], str]: ...
@property
def python_type(self) -> Union[Type[float], Type[decimal.Decimal]]: ... # type: ignore # return type incompatible
def bind_processor(self, dialect: Dialect) -> Optional[Callable[[Optional[str]], float]]: ...
def bind_processor(self, dialect: Dialect) -> Optional[Callable[[Optional[str]], decimal.Decimal]]: ...
def result_processor(self, dialect: Dialect, coltype: Any) -> Optional[Callable[[Optional[Any]],
Optional[Union[float, decimal.Decimal]]]]: ...

Expand Down