diff --git a/src/sagemaker_core/main/utils.py b/src/sagemaker_core/main/utils.py index 39176128..126aa556 100644 --- a/src/sagemaker_core/main/utils.py +++ b/src/sagemaker_core/main/utils.py @@ -457,13 +457,13 @@ def __next__(self) -> T: elif ( len(self.summary_list) > 0 and self.index >= len(self.summary_list) - and self.next_token is None + and (not self.next_token) ): raise StopIteration # Otherwise, get the next page of summaries by calling the list method with the next token if available else: - if self.next_token is not None: + if self.next_token: response = getattr(self.client, self.list_method)( NextToken=self.next_token, **self.list_method_kwargs )