Skip to content

Commit

Permalink
Merge branch 'main' into native-namespace-compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
kiraksi authored Nov 28, 2023
2 parents f7587d9 + 1683879 commit b409420
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions samples/quickstart/quickstart.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,14 @@ def main(project_id="your-project-id", snapshot_millis=0):
names = set()
states = set()

for row in rows:
names.add(row["name"])
states.add(row["state"])
# fastavro returns EOFError instead of StopIterationError starting v1.8.4.
# See https://github.com/googleapis/python-bigquery-storage/pull/687
try:
for row in rows:
names.add(row["name"])
states.add(row["state"])
except EOFError:
pass

print("Got {} unique names in states: {}".format(len(names), ", ".join(states)))
# [END bigquerystorage_quickstart]
Expand Down

0 comments on commit b409420

Please sign in to comment.