|
34 | 34 | from google.api_core.gapic_v1 import client_info as client_info_lib |
35 | 35 | from google.auth.credentials import AnonymousCredentials # type: ignore |
36 | 36 |
|
37 | | -from google.cloud import bigtable_v2 |
38 | 37 | from google.cloud import bigtable_admin_v2 |
39 | | -from google.cloud.bigtable_v2.services.bigtable.transports import BigtableGrpcTransport |
40 | 38 | from google.cloud.bigtable_admin_v2.services.bigtable_instance_admin.transports import ( |
41 | 39 | BigtableInstanceAdminGrpcTransport, |
42 | 40 | ) |
@@ -150,7 +148,6 @@ class Client(ClientWithProject): |
150 | 148 | _table_data_client = None |
151 | 149 | _table_admin_client = None |
152 | 150 | _instance_admin_client = None |
153 | | - _new_table_data_client = None |
154 | 151 |
|
155 | 152 | def __init__( |
156 | 153 | self, |
@@ -295,18 +292,7 @@ def table_data_client(self): |
295 | 292 | :rtype: :class:`.bigtable_v2.BigtableClient` |
296 | 293 | :returns: A BigtableClient object. |
297 | 294 | """ |
298 | | - if self._table_data_client is None: |
299 | | - transport = self._create_gapic_client_channel( |
300 | | - bigtable_v2.BigtableClient, |
301 | | - BigtableGrpcTransport, |
302 | | - ) |
303 | | - klass = _create_gapic_client( |
304 | | - bigtable_v2.BigtableClient, |
305 | | - client_options=self._client_options, |
306 | | - transport=transport, |
307 | | - ) |
308 | | - self._table_data_client = klass(self) |
309 | | - return self._table_data_client |
| 295 | + return self._data_client._gapic_client |
310 | 296 |
|
311 | 297 | @property |
312 | 298 | def table_admin_client(self): |
@@ -375,21 +361,17 @@ def instance_admin_client(self): |
375 | 361 | return self._instance_admin_client |
376 | 362 |
|
377 | 363 | @property |
378 | | - def new_table_data_client(self): |
379 | | - """Getter for the new Data Table API. |
380 | | -
|
381 | | - TODO: Replace table_data_client with this implementation |
382 | | - when shimming legacy client is finished. |
383 | | - """ |
384 | | - if self._new_table_data_client is None: |
385 | | - self._new_table_data_client = BigtableDataClient( |
| 364 | + def _data_client(self): |
| 365 | + """Getter for the new Data Table API.""" |
| 366 | + if self._table_data_client is None: |
| 367 | + self._table_data_client = BigtableDataClient( |
386 | 368 | project=self.project, |
387 | 369 | credentials=self._credentials, |
388 | 370 | client_options=self._client_options, |
389 | | - client_info=self._client_info, |
390 | | - disable_background_channel_refresh=True, |
| 371 | + _client_info=self._client_info, |
| 372 | + _disable_background_channel_refresh=True, |
391 | 373 | ) |
392 | | - return self._new_table_data_client |
| 374 | + return self._table_data_client |
393 | 375 |
|
394 | 376 | def instance(self, instance_id, display_name=None, instance_type=None, labels=None): |
395 | 377 | """Factory to create a instance associated with this client. |
|
0 commit comments