This is an automated email from the ASF dual-hosted git repository.

riteshghorse pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git


The following commit(s) were added to refs/heads/master by this push:
     new 21f822f6580 Catch EOFError along with StopIteration (#28896)
21f822f6580 is described below

commit 21f822f6580f04c3bd581005d93846e555982367
Author: Ritesh Ghorse <[email protected]>
AuthorDate: Mon Oct 9 14:14:07 2023 -0400

    Catch EOFError along with StopIteration (#28896)
    
    * catch EOF instead of StopIteration
    
    * add stop iteration to close
    
    * catch both stop iteration and EOF
---
 sdks/python/apache_beam/io/gcp/bigquery.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sdks/python/apache_beam/io/gcp/bigquery.py 
b/sdks/python/apache_beam/io/gcp/bigquery.py
index 986919fd6b8..184138af752 100644
--- a/sdks/python/apache_beam/io/gcp/bigquery.py
+++ b/sdks/python/apache_beam/io/gcp/bigquery.py
@@ -1310,7 +1310,7 @@ class _ReadReadRowsResponsesWithFastAvro():
   def __next__(self):
     try:
       return fastavro.schemaless_reader(self.bytes_reader, self.avro_schema)
-    except StopIteration:
+    except (StopIteration, EOFError):
       self.read_rows_response = next(self.read_rows_iterator, None)
       if self.read_rows_response is not None:
         self.bytes_reader = io.BytesIO(

Reply via email to