Skip to content

Commit

Permalink
fix: resolve issue AttributeError in bigquery_storage writer
Browse files Browse the repository at this point in the history
  • Loading branch information
parthea committed Mar 14, 2022
1 parent 07ba231 commit 3956003
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion google/cloud/bigquery_storage_v1/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ def _open(
# ValueError: Can not send() on an RPC that has never been open()ed.
#
# when they try to send a request.
while not self._rpc.is_active and self._consumer.is_active:
while self._rpc and not self._rpc.is_active and self._consumer and self._consumer.is_active:
# Avoid 100% CPU while waiting for RPC to be ready.
time.sleep(_WRITE_OPEN_INTERVAL)

Expand Down
2 changes: 1 addition & 1 deletion google/cloud/bigquery_storage_v1beta2/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ def _open(
# ValueError: Can not send() on an RPC that has never been open()ed.
#
# when they try to send a request.
while not self._rpc.is_active and self._consumer.is_active:
while self._rpc and not self._rpc.is_active and self._consumer and self._consumer.is_active:
# Avoid 100% CPU while waiting for RPC to be ready.
time.sleep(_WRITE_OPEN_INTERVAL)

Expand Down

0 comments on commit 3956003

Please sign in to comment.