chamikaramj commented on a change in pull request #14690:
URL: https://github.com/apache/beam/pull/14690#discussion_r652329059



##########
File path: sdks/python/apache_beam/io/gcp/bigquery_tools.py
##########
@@ -632,22 +639,21 @@ def _insert_all_rows(
         base_labels=labels)
 
     started_millis = int(time.time() * 1000)
-    response = None
     try:
-      response = self.client.tabledata.InsertAll(request)
-      if not response.insertErrors:
+      table_ref = gcp_bigquery.DatasetReference(project_id,
+                                                dataset_id).table(table_id)
+      errors = self.gcp_bq_client.insert_rows_json(
+          table_ref, json_rows=rows, row_ids=insert_ids, 
skip_invalid_rows=True)
+      if not errors:
         service_call_metric.call('ok')
-      for insert_error in response.insertErrors:
-        for error in insert_error.errors:
-          service_call_metric.call(error.reason)
+      for insert_error in errors:
+        service_call_metric.call(insert_error['errors'][0])
     except HttpError as e:

Review comment:
       Not rebased ? 
(https://github.com/apache/beam/commit/e959d621c1553a556eea8ed0b6bc9e27bd0452ac#diff-5427a5d3887eb695cefde082c58575a2372972996b547d55961abeb4f7bc3deb)




-- 
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.

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


Reply via email to