From bff2cbb4944808ca0f9ef6f871df6ffa8505622b Mon Sep 17 00:00:00 2001 From: claudevdm <33973061+claudevdm@users.noreply.github.com> Date: Mon, 18 Nov 2024 13:53:17 -0500 Subject: [PATCH] Use random gcs bucket name (#33151) * Use random gcs bucket name * Linter fixes --------- Co-authored-by: Claude --- sdks/python/apache_beam/ml/transforms/base_test.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sdks/python/apache_beam/ml/transforms/base_test.py b/sdks/python/apache_beam/ml/transforms/base_test.py index df5bf826742e..1a21f6caf7e1 100644 --- a/sdks/python/apache_beam/ml/transforms/base_test.py +++ b/sdks/python/apache_beam/ml/transforms/base_test.py @@ -17,8 +17,10 @@ # pytype: skip-file import os +import secrets import shutil import tempfile +import time import typing import unittest from collections.abc import Sequence @@ -699,7 +701,7 @@ def test_mltransform_to_ptransform_wrapper(self): @unittest.skipIf(apiclient is None, 'apache_beam[gcp] is not installed.') def test_with_gcs_location_with_none_options(self): - path = 'gs://fake_path' + path = f"gs://fake_path_{secrets.token_hex(3)}_{int(time.time())}" with self.assertRaises(RuntimeError): self.attribute_manager.save_attributes( ptransform_list=[], artifact_location=path, options=None)