-
Notifications
You must be signed in to change notification settings - Fork 59
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
chore: add cross_sync annotations #1000
Conversation
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.
Is there a test to validate that the sync surface is re-generated when there's change to async code?
), | ||
"RAISE_NO_LOOP": ( | ||
"RuntimeError: if called outside of an async context (no running event loop)", | ||
"", |
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.
Ok, let's change this to None to be consistent with other methods?
if CrossSync.is_async: | ||
from google.cloud.bigtable.data._async.client import TableAsync as TableType | ||
else: | ||
from google.cloud.bigtable.data._sync_autogen.client import Table as TableType # type: ignore |
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.
dumb question.. isn't _sync_autogen.client also generated from cross sync? how can we import a not yet generated class?
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.
Yeah, good point, this should really just be in the next PR, since the file doesn't exist yet
For the "how" part: this import statement isn't actually executed, since it's behind an if False
branch. This import is just for the generated file
google/cloud/bigtable/data/execute_query/_async/execute_query_iterator.py
Outdated
Show resolved
Hide resolved
Yes, but that's in the next PR, since we don't have the generated files here yet |
PR 2/x for adding the sync surface for the new data client
This PR restructures the existing async library to better support the sync side. Specifically:
Currently, we need to run the conversion process manually (using
python .cross_sync/generate.py
, and the sync files are not included in the codebase. The next PR will add the sync artifacts, and add the generation pipeline into the CI system