ahmedabu98 commented on code in PR #26491:
URL: https://github.com/apache/beam/pull/26491#discussion_r1185529396


##########
sdks/python/apache_beam/io/external/xlang_bigqueryio_it_test.py:
##########
@@ -234,6 +244,43 @@ def test_storage_write_beam_rows(self):
               table=table_id, expansion_service=self.expansion_service))
     hamcrest_assert(p, bq_matcher)
 
+  def run_streaming(self, table_name, auto_sharding=False):
+    elements = self.ELEMENTS.copy()
+    schema = self.ALL_TYPES_SCHEMA
+    table_id = '{}:{}.{}'.format(self.project, self.dataset_id, table_name)
+
+    bq_matcher = BigqueryFullResultStreamingMatcher(
+        project=self.project,
+        query="SELECT * FROM {}.{}".format(self.dataset_id, table_name),
+        data=self.parse_expected_data(self.ELEMENTS))
+
+    args = self.test_pipeline.get_full_options_as_args(
+        on_success_matcher=bq_matcher,
+        streaming=True,
+        allow_unsafe_triggers=True)
+
+    with beam.Pipeline(argv=args) as p:
+      _ = (
+          p
+          | GenerateSequence(
+              start=0, stop=4, expansion_service=self.expansion_service)
+          | beam.Map(lambda x: elements[x])
+          | beam.io.WriteToBigQuery(
+              table=table_id,
+              method=beam.io.WriteToBigQuery.Method.STORAGE_WRITE_API,
+              schema=schema,
+              with_auto_sharding=auto_sharding,
+              expansion_service=self.expansion_service))
+    hamcrest_assert(p, bq_matcher)
+
+  def test_streaming(self):

Review Comment:
   Done



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