GraphServer: Remove reliance on CloudSpanner's TypeCode#48
Merged
cqian23 merged 5 commits intoJun 12, 2025
Conversation
Collaborator
smukil
commented
Jun 12, 2025
- Also removes cloud-spanner specific fields from the return type. Specifically `StructType.Field` is removed from the return type. Removing this tightly coupled logic is required to allow new DB implementations.
…f DB implementation with APIs 1. Abstracts SpannerDatabase with clear APIs 2. Introduces CloudSpannerDatabase as an implementation of SpannerDatabase 3. Removes further tight coupling with the cloud spanner client by adding a SpannerFieldInfo dataclass to replace usage of StructType.Field
1. The global database_instances is moved to exec_env.py to avoid circular imports. 2. SpannerFiledInfo.typename populated with the correct name now 3. Remove all cloud spanner refs from database.py
The google.cloud.spanner.TypeCode was used to validate supported types for properties. However, the type information is always received as a string from the JS client. It is only internally converted to a TypeCode for verification. Comparing against the TypeCode does not make the validation any more robust than just confirming if the strings themselves are valid type strings. Removing reliance on TypeCode also makes GraphServer database agnostic.
All consumers of SpannerQueryResult expect `err` instead of `error`. Without this fix, failures are silent. With this, they're displayed within the notebook. Thanks to @cqian23 for pointing this out
3e5a6cc to
d0e2a5e
Compare
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.