Skip to content

Commit 9833974

Browse files
authored
Remove legacy HttpError usage in Bigtable I/O IT test (#39441)
1 parent 0140552 commit 9833974

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

sdks/python/apache_beam/io/gcp/bigtableio_it_test.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838

3939
# Protect against environments where bigtable library is not available.
4040
try:
41-
from apitools.base.py.exceptions import HttpError
41+
from google.api_core.exceptions import GoogleAPICallError
4242
from google.cloud.bigtable import client
4343
from google.cloud.bigtable.row import Cell
4444
from google.cloud.bigtable.row import DirectRow
@@ -48,7 +48,7 @@
4848
from google.cloud.bigtable_admin_v2.types import instance
4949
except ImportError as e:
5050
client = None
51-
HttpError = None
51+
GoogleAPICallError = None
5252

5353

5454
def instance_prefix(instance):
@@ -109,7 +109,7 @@ def tearDown(self):
109109
self.instance.instance_id)
110110
self.table.delete()
111111
self.instance.delete()
112-
except HttpError:
112+
except GoogleAPICallError:
113113
_LOGGER.warning(
114114
"Failed to clean up table [%s] and instance [%s]",
115115
self.table.table_id,
@@ -208,15 +208,15 @@ def tearDown(self):
208208
try:
209209
_LOGGER.info("Deleting table [%s]", self.table.table_id)
210210
self.table.delete()
211-
except HttpError:
211+
except GoogleAPICallError:
212212
_LOGGER.warning("Failed to clean up table [%s]", self.table.table_id)
213213

214214
@classmethod
215215
def tearDownClass(cls):
216216
try:
217217
_LOGGER.info("Deleting instance [%s]", cls.instance.instance_id)
218218
cls.instance.delete()
219-
except HttpError:
219+
except GoogleAPICallError:
220220
_LOGGER.warning(
221221
"Failed to clean up instance [%s]", cls.instance.instance_id)
222222

0 commit comments

Comments
 (0)