-
Notifications
You must be signed in to change notification settings - Fork 139
Column type selection for BIGNUMERIC vs NUMERIC is incorrect #1164
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
Thank you, I think you are using the parameterized decimal type here (meaning you specify the precision and scale), and in this case, the max precision available is 29. So I think the documentation is correct here, but we can sure try to catch this in the library, so it's less confusing. |
@Linchin no, the logic for setting the column type (in the generated BQ SQL) is incorrect. See my PR. Its setting the type as |
@claytonjroberts The problem is |
Ah, I see what you mean about the documentation. I apologize, I should have scrolled down, lol. For other readers:
But, because the This lib will (incorrectly) try to use |
Yeah, we need to change it so it covers both the default NUMERIC/BIGNUMERIC and the parameterized NUMERIC/BIGNUMERIC. @claytonjroberts If you are interested, feel free to update your PR :) Otherwise we can take care of it too. |
I think it does, doesn't it? Can you explain what needs to be changed in my code? Happy to do it. :) |
I will comment in the PR :) |
Description
There is a discrepancy between the documentation for numeric types and what appears when creating a numeric column:
from the BigQuery Console
Environment details
Python 3.11.10
pip 24.0
sqlalchemy-bigquery
version:Version: 1.12.0
Steps to reproduce
NUMERIC
withprecision=37
andscale=0
using SQLAlchemyCode example
Stack trace
The text was updated successfully, but these errors were encountered: