From 536c6d26bc8ce474df398e891f3c88e5d20f9032 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Thu, 30 Nov 2023 21:45:19 +0000 Subject: [PATCH 1/2] chore: partial revert of PR #357 This reverts commit e120a0cdb589d390848b0711ff21c9ff4aab26a9. --- google/api_core/bidi.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/google/api_core/bidi.py b/google/api_core/bidi.py index 74abc495..cbad4c7c 100644 --- a/google/api_core/bidi.py +++ b/google/api_core/bidi.py @@ -92,7 +92,10 @@ def _is_active(self): # Note: there is a possibility that this starts *before* the call # property is set. So we have to check if self.call is set before # seeing if it's active. - return self.call is not None and self.call.is_active() + if self.call is not None and not self.call.is_active(): + return False + else: + return True def __iter__(self): if self._initial_request is not None: From 744054557991aa22944bf5f50e8a8aba7dfdbdc8 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Thu, 30 Nov 2023 21:48:34 +0000 Subject: [PATCH 2/2] add comment --- google/api_core/bidi.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/google/api_core/bidi.py b/google/api_core/bidi.py index cbad4c7c..17d836d5 100644 --- a/google/api_core/bidi.py +++ b/google/api_core/bidi.py @@ -91,7 +91,8 @@ def __init__(self, queue, period=1, initial_request=None): def _is_active(self): # Note: there is a possibility that this starts *before* the call # property is set. So we have to check if self.call is set before - # seeing if it's active. + # seeing if it's active. We need to return True if self.call is None. + # See https://github.com/googleapis/python-api-core/issues/560. if self.call is not None and not self.call.is_active(): return False else: