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

yhu 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 bb7b64abac3 Fix PipelineOptionTest.test_display_data (#25007)
bb7b64abac3 is described below

commit bb7b64abac340bd1398f1f979f78fcb89c49e576
Author: Yi Hu <[email protected]>
AuthorDate: Tue Jan 17 09:44:20 2023 -0500

    Fix PipelineOptionTest.test_display_data (#25007)
---
 sdks/python/apache_beam/examples/snippets/snippets.py | 2 +-
 sdks/python/apache_beam/io/gcp/bigquery_test.py       | 8 ++++++++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/sdks/python/apache_beam/examples/snippets/snippets.py 
b/sdks/python/apache_beam/examples/snippets/snippets.py
index c3d94fb3a68..aabbb95db3a 100644
--- a/sdks/python/apache_beam/examples/snippets/snippets.py
+++ b/sdks/python/apache_beam/examples/snippets/snippets.py
@@ -1442,7 +1442,7 @@ def accessing_valueprovider_info_after_run():
 
   import apache_beam as beam
   from apache_beam.options.pipeline_options import PipelineOptions
-  from apache_beam.utils.value_provider import RuntimeValueProvider
+  from apache_beam.options.value_provider import RuntimeValueProvider
 
   class MyOptions(PipelineOptions):
     @classmethod
diff --git a/sdks/python/apache_beam/io/gcp/bigquery_test.py 
b/sdks/python/apache_beam/io/gcp/bigquery_test.py
index 02e6fb04c47..18048e94054 100644
--- a/sdks/python/apache_beam/io/gcp/bigquery_test.py
+++ b/sdks/python/apache_beam/io/gcp/bigquery_test.py
@@ -20,6 +20,7 @@
 
 import datetime
 import decimal
+import gc
 import json
 import logging
 import os
@@ -303,6 +304,13 @@ class TestReadFromBigQuery(unittest.TestCase):
     # Reset runtime options to avoid side-effects caused by other tests.
     RuntimeValueProvider.set_runtime_options(None)
 
+  @classmethod
+  def tearDownClass(cls):
+    # Unset the option added in setupClass to avoid interfere with other tests.
+    # Force a gc so PipelineOptions.__subclass__() no longer contains it.
+    del cls.UserDefinedOptions
+    gc.collect()
+
   def test_get_destination_uri_empty_runtime_vp(self):
     with self.assertRaisesRegex(ValueError,
                                 '^ReadFromBigQuery requires a GCS '

Reply via email to