8000 fix: types reflection by IlyaFaer · Pull Request #33 · googleapis/python-spanner-sqlalchemy · GitHub
[go: up one dir, main page]

Skip to content

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

Merged
merged 16 commits into from
Apr 7, 2021
Merged

fix: types reflection #33

merged 16 commits into from
Apr 7, 2021

Conversation

IlyaFaer
Copy link
Contributor
@IlyaFaer IlyaFaer commented Mar 19, 2021

This PR is based on #32.

@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Mar 19, 2021
@@ -33,7 +33,7 @@
"DATETIME": types.DATETIME,
"FLOAT64": types.Float,
"INT64": types.BIGINT,
"NUMERIC": types.DECIMAL,
"NUMERIC": types.NUMERIC(precision=38, scale=9),
Copy link
Contributor Author

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]]
Copy link
Contributor Author
@IlyaFaer IlyaFaer Mar 19, 2021

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.

@IlyaFaer
Copy link
Contributor Author
IlyaFaer commented Mar 19, 2021

@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.

image

@IlyaFaer
Copy link
Contributor Author

@larkee, here I'm also adding results testing group into the test suite, as all the tests of the group seem to be processed:

PercentSchemaNamesTest are test cases to test if % symbol can be used in column, table, schema names. % can't be used in Spanner identifier, so leaving the tests skipped.

ServerSideCursorsTest - I didn't find any mentions of server cursors in Spanner, so I assume it's not supported, and the test case can stay skipped.

Безымянный

@IlyaFaer IlyaFaer requested a review from larkee April 7, 2021 08:22
@AVaksman AVaksman merged commit a1b4103 into main Apr 7, 2021
@IlyaFaer IlyaFaer deleted the types_reflection branch April 8, 2021 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0