6464DELETE_WORKFLOW_STEPS = 2
6565DEACTIVATE_WORKFLOW_STEPS = 2
6666DEFAULT_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 ]
6869
6970MODEL_DEPLOYMENT_KIND = "deployment"
7071MODEL_DEPLOYMENT_TYPE = "modelDeployment"
@@ -748,12 +749,7 @@ def watch(
748749 The instance of ModelDeployment.
749750 """
750751 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 :
757753 status = self ._check_and_print_status (status )
758754 time .sleep (interval )
759755
@@ -777,8 +773,8 @@ def watch(
777773 pass
778774
779775 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
782778
783779 def _check_and_print_status (self , prev_status ) -> str :
784780 """Check and print the next status.
0 commit comments