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

fix: add missing imports in __init__.py for autogenerated code #1049

Closed
wants to merge 2 commits into from

Conversation

parthea
Copy link
Contributor

@parthea parthea commented Dec 5, 2023

Fixes b/313264660

This PR migrates owlbot.py to use the autogenerated google/cloud/spanner_v1/__init__.py. This is needed so that modules which are added to the autogenerated code can be imported easily. For example, from google.cloud.spanner_v1 import SpannerAsyncClient instead of from google.cloud.spanner_v1.services.spanner import SpannerAsyncClient

To run owlbot locally,

  1. In a clone of googleapis/googleapis, run the following bazel build commands
bazel build //google/spanner/v1:spanner-v1-py
bazel build //google/spanner/admin/database/v1:admin-database-v1-py
bazel build //google/spanner/admin/instance/v1:admin-instance-v1-py
  1. Check out the branch in this PR and run the following command to copy the code generated using bazel
docker run --rm --user $(id -u):$(id -g)   -v $(pwd):/repo   -v $HOME/git/googleapis/bazel-bin:/bazel-bin   gcr.io/cloud-devrel-public-resources/owlbot-cli:latest copy-bazel-bin   --source-dir /bazel-bin --dest /repo
  1. Run post processing using this command
docker run --user $(id -u):$(id -g) --rm -v $(pwd):/repo -w /repo [gcr.io/cloud-devrel-public-resources/owlbot-python:latest](http://gcr.io/cloud-devrel-public-resources/owlbot-python:latest)

@product-auto-label product-auto-label bot added size: m Pull request size is medium. api: spanner Issues related to the googleapis/python-spanner API. labels Dec 5, 2023
@parthea parthea marked this pull request as ready for review December 6, 2023 11:39
@parthea parthea requested review from a team as code owners December 6, 2023 11:39
harshachinta
harshachinta previously approved these changes Dec 6, 2023
Copy link
Contributor

@harshachinta harshachinta left a comment

Choose a reason for hiding this comment

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

Will take a look

@harshachinta harshachinta self-requested a review December 6, 2023 11:57
@parthea parthea added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Dec 6, 2023
@harshachinta harshachinta dismissed their stale review December 6, 2023 11:58

Need some understanding on this PR

@parthea parthea closed this Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: spanner Issues related to the googleapis/python-spanner API. do not merge Indicates a pull request not ready for merge, due to either quality or timing. size: m Pull request size is medium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants