Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

gkevinzheng
Copy link
Contributor

The changes to UPGRADING.md here builds upon some of the changes to UPGRADING.md in #1169 with additions for admin client migration.

@gkevinzheng gkevinzheng requested review from a team as code owners August 26, 2025 20:43
@product-auto-label product-auto-label bot added the size: s Pull request size is small. label Aug 26, 2025
@product-auto-label product-auto-label bot added the api: bigtable Issues related to the googleapis/python-bigtable API. label Aug 26, 2025
UPGRADING.md Outdated

### Admin Client Migration

While we do recommend you instantiate the new admin API clients directly, you can access the new admin API
Copy link
Contributor

Choose a reason for hiding this comment

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

We should show how to do it the recommended way first. Maybe something like:

The TableAdminClient can now be imported directly from google.cloud.bigtable.admin. This is the new recommended approach:
from google.cloud.bigtable.admin import TableAdminClient
...
Access to the admin clients through google.cloud.bigtable.Client is also supported for backward compatibility:
...

@product-auto-label product-auto-label bot added size: m Pull request size is medium. and removed size: s Pull request size is small. labels Aug 27, 2025
Comment on lines +15 to +45
### Admin Client Migration

We recommend that you instantiate the new admin API clients directly:

```
from google.cloud.bigtable.admin import (
BigtableInstanceAdminClient,
BigtableInstanceAdminAsyncClient,
BigtableTableAdminClient,
BigtableTableAdminAsyncClient,
)

instance_admin_client = BigtableInstanceAdminClient()
instance_admin_async_client = BigtableInstanceAdminAsyncClient()
table_admin_client = BigtableTableAdminClient()
table_admin_async_client = BigtableTableAdminAsyncClient()
```

Access to the new admin API sync clients via the `google.cloud.bigtable.Client` class is also supported for backwards compatibility:

```
from google.cloud.bigtable import Client

client = Client()

# google.cloud.bigtable.admin.BigtableInstanceAdminClient
instance_admin_client = client.instance_admin_client()

# google.cloud.bigtable.admin.BigtableTableAdminClient
table_admin_client = client.table_admin_client()
```

Choose a reason for hiding this comment

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

What if user add new client with the future-proof import, in addition to existing client like the following?

i.e.

# User's existing code

from google.cloud.bigtable import Client
client = Client()
instance_admin_client = client.instance_admin_client()

# Added new code to try out the "correct way" of importing new client"
from google.cloud.bigtable.admin import BigtableInstanceAdminClient
instance_admin_client_new = BigtableInstanceAdminClient()

I guess this technically would create two clients which we don't want?


The deprecated client will remain available as an alternative API surface, which internally delegates calls to the respective new clients. For most users, existing code will continue to work as before. But there may be some breaking changes associated with this update, which are detailed in this document.

### Admin Client Migration
Copy link

@iam-ethan-huang iam-ethan-huang Sep 3, 2025

Choose a reason for hiding this comment

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

Currently it is more like a quick-start guide, instead of the migration guide.

For migration, we should start from the code users have from legacy client and suggest what to do from there.

For example:
Path A (if you have time) - Add new import, remove old import, and convert all methods to new style, rebuild, test.
Path B (if you don't have time, but want to get new features) - Get new client via legacy client and use it.

And indicate the path B is only for backward compatible phase and will be eventually deprecated.

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: m Pull request size is medium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants