-
Notifications
You must be signed in to change notification settings - Fork 32
fix: types reflection #33
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
Conversation
@@ -33,7 +33,7 @@ | |||
"DATETIME": types.DATETIME, | |||
"FLOAT64": types.Float, | |||
"INT64": types.BIGINT, | |||
"NUMERIC": types.DECIMAL, | |||
"NUMERIC": types.NUMERIC(precision=38, scale=9), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Constant precision and scale
size = int(col[1][7:end]) | ||
type_ = _type_map["STRING"](length=size) | ||
else: | ||
type_ = _type_map[col[1]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While reflecting column types, we're reading strings like STRING(size)
from information_schema
. Such a string can be parsed to get the column size - to set it into SQLAlchemy reflected type.
@larkee, I assume, something similar is required for BYTES (you mentioned their MAX size in the dialect), so I'm looking forward for BYTES types test.
@larkee, as this PR is based on #32 and 32 is based on #24, the branch includes all the changes of my last three PRs. With all of this I have only three reflection tests failing. Most of the skipped tests are related to the named schemas feature, so they are going to stay skipped. Thus, we're almost there with reflection I suppose. |
@larkee, here I'm also adding
|
This PR is based on #32.