-
Notifications
You must be signed in to change notification settings - Fork 99
Data type for Numeric column should be Decimal, not float #131
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
Comments
That seems plausible. Do you want to submit a PR? I am worried about whether this will cause problems if a lot of existing code assumes float already, though? But if that is wrong, maybe that's a good thing |
Yes, happy to submit a PR and I agree that if existing code assumes float, fixing this will likely help those users to uncover a wrong type assumption. |
Any word on when this will make it into a release? Would save me quite a few |
I'm also very interested if there any news on when this fix will be included in a release. |
Looks like this issue is fixed, can we release the fix? |
I'm also wondering when this fix will go in? |
I am going to make a release later today. Please test with current master to check if there are any issues. |
(closing the issue since IIUC this is fixed in master) |
Uh oh!
There was an error while loading. Please reload this page.
The official SQLAlchemy documentation for the column type
Numeric
says:https://docs.sqlalchemy.org/en/13/core/type_basics.html#sqlalchemy.types.Numeric
Currently this is specified in sqltypes.pyi as
TypeEngine[float]
but by default the inner data type for Numeric should beDecimal
, notfloat
. That would be more in line withThe current approach reports typing errors even though the code is correct (due to the float/Decimal confusion) . Example to reproduce:
This code is 100% correctly typed, but since the sqlalchemy-stubs use float instead of Decimal we receive a typing-error message that we shouldn't get:
The text was updated successfully, but these errors were encountered: