-
Notifications
You must be signed in to change notification settings - Fork 62
chore: Moved admin client to google.cloud.bigtable.admin/admin_v2 #1204
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
base: v3_staging
Are you sure you want to change the base?
Conversation
No region tags are edited in this PR.This comment is generated by snippet-bot.
|
|
|
||
| data_client/data_client_usage | ||
| classic_client/usage | ||
| admin_client/admin_client_usage |
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.
I probably would have preferred to have the new docs as a separate PR to keep things focused, but probably not a big deal
| @@ -0,0 +1,274 @@ | |||
| # -*- coding: utf-8 -*- | |||
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.
do we have to have both google.cloud.bigtable.admin and google.cloud.bigtable.admin_v2? I thought we'd just need google.cloud.bigtable.admin
It seems confusing to have google.cloud.bigtable.admin, google.cloud.bigtable.admin_v2, google.cloud.bigtable_admin, and google.cloud.bigtable.admin_v2. Maybe we should reconsider
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.
The GAPIC structure is that google.cloud.bigtable.admin aliases to google.cloud.bigtable.admin_v<version>
| # | ||
| from .client import BigtableTableAdminClient | ||
|
|
||
| # TODO: Add the async client after owlbot changes. |
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.
What does this mean?
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.
Old TODO comment from before that I should delete
|
|
||
| # -------------------------------------------------------------------------- | ||
| # Admin Overlay work | ||
| # -------------------------------------------------------------------------- |
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.
I'm a bit confused why these new owlbot changes have to be added? Why are they only needed after this move?
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.
v3_staging doesn't have the selective GAPIC client in it right now, so I added it back in.
| @@ -0,0 +1,57 @@ | |||
| # -*- coding: utf-8 -*- | |||
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.
do we need to merge main into v3_staging?
|
Maybe we should make a small doc to make sure we're all aligned on what the final structure will look like? I'd hate to spend a lot of time iterating here if we have to move things back and forth a bunch Good to see import aliases aren't going to be a problem though |
|
It looks like the overlay and utils are duplicated in |
| from google.cloud.bigtable_admin_v2.overlay import * # noqa: F401, F403 | ||
|
|
||
| __all__ += google.cloud.bigtable_admin_v2.overlay.__all__ | ||
| __all__ = google.cloud.bigtable.admin.__all__ |
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.
Do we have test that try importing in different ways, to make sure they all work the same as before?
i.e. import google.cloud.bigtable.admin.Type, from google.cloud.bigtable.admin import Type, etc
| is_fresh_admin_v2_copy = \ | ||
| s.move(library / "google/cloud/bigtable_admin_v2", excludes=["**/gapic_version.py"]) | ||
| s.move(library / "tests") | ||
| s.move(library / "google/cloud/bigtable/admin_v2", |
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.
Do we need a CL to change google/cloud/bigtable_admin_v2 to google/cloud/bigtable/admin_v2?
Currently we generate google/cloud/bigtable_admin_v2
If we want google/cloud/bigtable/admin_v2 then we'll need to delete these lines
https://github.com/googleapis/googleapis/blob/a17b84add8318f780fcc8a027815d5fee644b9f7/google/bigtable/admin/v2/BUILD.bazel#L173-L174
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.
This is going to be merged into a staging branch. Closer to when that branch will be merged to main I will submit the CL to change google/cloud/bigtable_admin_v2 to google/cloud/bigtable/admin_v2.
| is_fresh_admin_v2_copy = \ | ||
| s.move(library / "google/cloud/bigtable_admin_v2", excludes=["**/gapic_version.py"]) | ||
| s.move(library / "tests") | ||
| s.move(library / "google/cloud/bigtable/admin_v2", |
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.
Could we merge #1232 first since we're moving off of owlbot.py?
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.
Note that this is going to a staging branch, not main, so it won't interfere with that work
Although I was concerned about whether that would cause merge conflicts here. So maybe we should still consider the ordering
Not intentional, will be removing them now. |
| ): | ||
| mod = importlib.import_module(name) | ||
| alias = name.replace(_NEW_PATH, __name__, 1) | ||
| sys.modules[alias] = mod |
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.
I'm curious why this is so different than google/cloud/bigtable_admin/__init__.py. Aren't they both aliases?
|
|
||
| __version__ = package_version.__version__ | ||
| # There are no subpackages exported from google.cloud.bigtable_admin, | ||
| # only an import alias for objects in google.cloud.bigtable_admin_v2. |
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.
it says alias of google.cloud.bigtable_admin_v2, but it looks like it's actually aliasing google.cloud.bigtable.admin? (Although I understand they should all be equivalent)
|
You should also consider moving the classic client alongside the others, something like this: #1200 Probably not in this PR though. We can consider that near the end |
Changes:
google.cloud.bigtable_admin/bigtable_admin_v2togoogle.cloud.bigtable.admin. The autogenerated portion of the library was generated as follows:This change will be committed close to when we will release the v3 client.
bigtable_admin/bigtable_admin_v2still work as intended.BigtableTableAdminClientinstead of theBaseBigtableTableAdminClientas its table admin client.Fixes #1155