Skip to content
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 #999

Open
wants to merge 260 commits into
base: main
Choose a base branch
from
Open

Conversation

daniel-sanche
Copy link
Contributor

@daniel-sanche daniel-sanche commented Jul 18, 2024

PR 1/x for adding the sync surface for the new data client

This class adds ast transformers for converting existing async classes into sync copies.

The conversion works through the following phases:

  • generate.py is called with a path, and finds all Python files in all subdirectories
  • CrossSyncClassDecoratorHandler is called on each file, looking for any classes decorated with @CrossSync.export_sync
  • For all classes found, they are passed through:
    • CrossSyncMethodDecoratorHandler to look for any methods annotated with CrossSync decorators (CrossSunc.convert, CrossSync.drop_method, CrossSync.pytest, etc).
    • RmAioFunctions to strip out any asyncio keywords annotated with CrossSync.rmaio()
    • SymbolReplacer to replace CrossSync with CrossSync._Sync_Impl in the codebase, and other user-specified symbol transformatioons

Next PR will add annotations to existing code to guide transformations


TODO:

  • add tests for new CrossSync functions
  • add CrossSync Readme

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigtable Issues related to the googleapis/python-bigtable API. size: xl Pull request size is extra large.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants