robertwb commented on code in PR #32584:
URL: https://github.com/apache/beam/pull/32584#discussion_r1779272397


##########
sdks/python/apache_beam/io/gcp/bigquery.py:
##########
@@ -1729,19 +1732,21 @@ def _flush_batch(self, destination):
     if destination in self._destination_buffer_byte_size:
       del self._destination_buffer_byte_size[destination]
 

Review Comment:
   In the retry loop above, with
   
   ```
   rows = [fr[0] for fr in failed_rows]
   ````
   do we also need to update `window_values` so the indices line up? (Looking 
at this, shouldn't insert_ids have been updated as well?)
   
   



##########
sdks/python/apache_beam/io/gcp/bigquery.py:
##########
@@ -1668,9 +1668,11 @@ def _flush_batch(self, destination):
     _LOGGER.debug(
         'Flushing data to %s. Total %s rows.',
         destination,
-        len(rows_and_insert_ids))
-    self.batch_size_metric.update(len(rows_and_insert_ids))
+        len(rows_and_insert_ids_with_windows))
+    self.batch_size_metric.update(len(rows_and_insert_ids_with_windows))
 
+    rows_and_insert_ids = [r[0] for r in rows_and_insert_ids_with_windows]

Review Comment:
   You can use the "zip to transpose" trick here. 
   
   ```
   rows_and_insert_ids, window_values = zip(*rows_and_insert_ids_with_windows)
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to