64
64
DELETE_WORKFLOW_STEPS = 2
65
65
DEACTIVATE_WORKFLOW_STEPS = 2
66
66
DEFAULT_RETRYING_REQUEST_ATTEMPTS = 3
67
- TERMINAL_STATES = [State .FAILED , State .DELETED , State .INACTIVE ]
67
+ TERMINAL_STATES = [State .ACTIVE , State .FAILED , State .DELETED , State .INACTIVE ]
68
+ WATCH_TERMINAL_STATES = [State .FAILED , State .DELETED , State .INACTIVE ]
68
69
69
70
MODEL_DEPLOYMENT_KIND = "deployment"
70
71
MODEL_DEPLOYMENT_TYPE = "modelDeployment"
@@ -748,12 +749,7 @@ def watch(
748
749
The instance of ModelDeployment.
749
750
"""
750
751
status = ""
751
- while self .state not in [
752
- State .ACTIVE ,
753
- State .FAILED ,
754
- State .DELETED ,
755
- State .INACTIVE
756
- ]:
752
+ while self .state not in TERMINAL_STATES :
757
753
status = self ._check_and_print_status (status )
758
754
time .sleep (interval )
759
755
@@ -777,8 +773,8 @@ def watch(
777
773
pass
778
774
779
775
def _stop_condition (self ):
780
- """Stops the sync once the model deployment is in a terminal state."""
781
- return self .state in TERMINAL_STATES
776
+ """Stops the watch sync once the model deployment is in a terminal state."""
777
+ return self .state in WATCH_TERMINAL_STATES
782
778
783
779
def _check_and_print_status (self , prev_status ) -> str :
784
780
"""Check and print the next status.
0 commit comments