FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix: types reflection by IlyaFaer · Pull Request #33 · googleapis/python-spanner-sqlalchemy · GitHub

This repository was archived by the owner on May 14, 2026. It is now read-only.

fix: types reflection - #33

Merged
AVaksman merged 16 commits into
mainfrom
types_reflection
Apr 7, 2021
Merged

AVaksman merged 16 commits into
mainfrom
types_reflection

Conversation

IlyaFaer commented Mar 19, 2021
edited
Loading

Copy link
Copy Markdown

This PR is based on #32.

google-cla Bot added the cla: yes This human has signed the Contributor License Agreement. label Mar 19, 2021
"FLOAT64": types.Float,
"INT64": types.BIGINT,
"NUMERIC": types.DECIMAL,
"NUMERIC": types.NUMERIC(precision=38, scale=9),

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Constant precision and scale

size = int(col[1][7:end])
type_ = _type_map["STRING"](length=size)
else:
type_ = _type_map[col[1]]

IlyaFaer Mar 19, 2021
edited
Loading

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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.

Comment thread test/test_suite.py

IlyaFaer commented Mar 19, 2021
edited
Loading

Copy link
Copy Markdown
Author

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

Copy link
Copy Markdown
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 requested a review from larkee April 7, 2021 08:22
AVaksman merged commit a1b4103 into main Apr 7, 2021
IlyaFaer deleted the types_reflection branch April 8, 2021 07:51
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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


Back | FazBrowse Home | New Git URL