Skip to content

Commit c23c0ad

Browse files
Zhenyi Qicopybara-github
Zhenyi Qi
authored andcommitted
fix: Allow non-lro delete method
PiperOrigin-RevId: 640765520
1 parent 70168eb commit c23c0ad

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

google/cloud/aiplatform/base.py

+9-5
Original file line numberDiff line numberDiff line change
@@ -1199,12 +1199,16 @@ def _list_with_local_order(
11991199
def _delete(self) -> None:
12001200
"""Deletes this Vertex AI resource. WARNING: This deletion is permanent."""
12011201
_LOGGER.log_action_start_against_resource("Deleting", "", self)
1202-
lro = getattr(self.api_client, self._delete_method)(name=self.resource_name)
1203-
_LOGGER.log_action_started_against_resource_with_lro(
1204-
"Delete", "", self.__class__, lro
1202+
possible_lro = getattr(self.api_client, self._delete_method)(
1203+
name=self.resource_name
12051204
)
1206-
lro.result()
1207-
_LOGGER.log_action_completed_against_resource("deleted.", "", self)
1205+
1206+
if possible_lro:
1207+
_LOGGER.log_action_started_against_resource_with_lro(
1208+
"Delete", "", self.__class__, possible_lro
1209+
)
1210+
possible_lro.result()
1211+
_LOGGER.log_action_completed_against_resource("deleted.", "", self)
12081212

12091213

12101214
class VertexAiResourceNounWithFutureManager(_VertexAiResourceNounPlus, FutureManager):

0 commit comments

Comments
 (0)