From 20c46c1f5f4fac70071694d330d1cc472f47bcc8 Mon Sep 17 00:00:00 2001 From: Yusuf Quazi Date: Wed, 30 Jul 2025 18:43:43 +0000 Subject: [PATCH 1/2] Fix: Handle invalid bucket path warning in Beam Python SDK --- sdks/python/apache_beam/options/pipeline_options.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sdks/python/apache_beam/options/pipeline_options.py b/sdks/python/apache_beam/options/pipeline_options.py index a7db5bfb0e71..b3dedf841fdc 100644 --- a/sdks/python/apache_beam/options/pipeline_options.py +++ b/sdks/python/apache_beam/options/pipeline_options.py @@ -1169,6 +1169,10 @@ def _handle_temp_and_staging_locations(self, validator): elif not staging_errors and not temp_errors: self._warn_if_soft_delete_policy_enabled('temp_location') self._warn_if_soft_delete_policy_enabled('staging_location') + _LOGGER.warning( + "Both temp_location and staging_location are invalid. " + "Expected format is 'gs:///'. " + "Attempting to create a default GCS bucket.") return [] # Both staging and temp locations are bad, try to use default bucket. else: From 8f33918fe6dd647ba24d7677180f42ab54b0be23 Mon Sep 17 00:00:00 2001 From: Yusuf Quazi Date: Wed, 30 Jul 2025 19:02:51 +0000 Subject: [PATCH 2/2] Fix: Handle invalid bucket path warning in Beam Python SDK, added to else block --- sdks/python/apache_beam/options/pipeline_options.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sdks/python/apache_beam/options/pipeline_options.py b/sdks/python/apache_beam/options/pipeline_options.py index b3dedf841fdc..fc0c9025dabd 100644 --- a/sdks/python/apache_beam/options/pipeline_options.py +++ b/sdks/python/apache_beam/options/pipeline_options.py @@ -1169,13 +1169,13 @@ def _handle_temp_and_staging_locations(self, validator): elif not staging_errors and not temp_errors: self._warn_if_soft_delete_policy_enabled('temp_location') self._warn_if_soft_delete_policy_enabled('staging_location') + return [] + # Both staging and temp locations are bad, try to use default bucket. + else: _LOGGER.warning( "Both temp_location and staging_location are invalid. " "Expected format is 'gs:///'. " "Attempting to create a default GCS bucket.") - return [] - # Both staging and temp locations are bad, try to use default bucket. - else: default_bucket = self._create_default_gcs_bucket() if default_bucket is None: temp_errors.extend(staging_errors)