@@ -143,7 +143,12 @@ def rollout_finished(
143143 details .append (ErrorInfo .termination_reason (termination_reason ).to_aip193_format ())
144144 if extra_info :
145145 details .append (ErrorInfo .extra_info (extra_info ).to_aip193_format ())
146- return cls (code = cls .Code .FINISHED , message = "Rollout finished" , details = details )
146+ return cls .finished ("Rollout finished" , details )
147+
148+ @classmethod
149+ def finished (cls , message : str , details : Optional [List [Dict [str , Any ]]] = None ) -> "Status" :
150+ """Create a status indicating the rollout finished."""
151+ return cls (code = cls .Code .FINISHED , message = message , details = details or [])
147152
148153 @classmethod
149154 def rollout_error (cls , error_message : str , extra_info : Optional [Dict [str , Any ]] = None ) -> "Status" :
@@ -156,7 +161,7 @@ def rollout_error(cls, error_message: str, extra_info: Optional[Dict[str, Any]]
156161 @classmethod
157162 def error (cls , error_message : str , details : Optional [List [Dict [str , Any ]]] = None ) -> "Status" :
158163 """Create a status indicating the rollout failed with an error."""
159- return cls (code = cls .Code .INTERNAL , message = error_message , details = details )
164+ return cls (code = cls .Code .INTERNAL , message = error_message , details = details or [] )
160165
161166 def is_running (self ) -> bool :
162167 """Check if the status indicates the rollout is running."""
0 commit comments