You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by "tvalentyn (via GitHub)" <gi...@apache.org> on 2026/07/13 16:22:54 UTC
[PR] Log temp/staging location options parsing errors. [beam]
tvalentyn opened a new pull request, #39305:
URL: https://github.com/apache/beam/pull/39305
(no comment)
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Log temp/staging location options parsing errors. [beam]
Posted by "gemini-code-assist[bot] (via GitHub)" <gi...@apache.org>.
gemini-code-assist[bot] commented on code in PR #39305:
URL: https://github.com/apache/beam/pull/39305#discussion_r3572333800
##########
sdks/python/apache_beam/options/pipeline_options.py:
##########
@@ -1243,18 +1243,27 @@ def _warn_if_soft_delete_policy_enabled(self, arg_name):
key="message")
except ImportError:
_LOGGER.warning('Unable to check soft delete policy due to import error.')
-
# If either temp or staging location has an issue, we use the valid one for
# both locations. If both are bad we return an error.
def _handle_temp_and_staging_locations(self, validator):
temp_errors = validator.validate_gcs_path(self, 'temp_location')
staging_errors = validator.validate_gcs_path(self, 'staging_location')
+
+ temp_location = getattr(self, 'temp_location', None)
+ staging_location = getattr(self, 'staging_location', None)
+
+ if temp_location is not None and temp_errors:
+ _LOGGER.warning(temp_errors[0])
+
+ if staging_location is not None and staging_errors:
+ _LOGGER.warning(staging_errors[0])
+
if temp_errors and not staging_errors:
- setattr(self, 'temp_location', getattr(self, 'staging_location'))
+ setattr(self, 'temp_location', staging_location)
self._warn_if_soft_delete_policy_enabled('staging_location')
return []
elif staging_errors and not temp_errors:
- setattr(self, 'staging_location', getattr(self, 'temp_location'))
+ setattr(self, 'staging_location', temp_location)
self._warn_if_soft_delete_policy_enabled('temp_location')
return []
Review Comment:

Logging warnings unconditionally for both `temp_location` and `staging_location` when they are invalid results in redundant log messages when both locations are invalid (which is a fatal error that will be raised anyway). Instead, we should only log these warnings when we are actually falling back to the other location.
```suggestion
if temp_errors and not staging_errors:
if temp_location is not None:
_LOGGER.warning(temp_errors[0])
setattr(self, 'temp_location', staging_location)
self._warn_if_soft_delete_policy_enabled('staging_location')
return []
elif staging_errors and not temp_errors:
if staging_location is not None:
_LOGGER.warning(staging_errors[0])
setattr(self, 'staging_location', temp_location)
self._warn_if_soft_delete_policy_enabled('temp_location')
return []
```
##########
sdks/python/apache_beam/options/pipeline_options_validator.py:
##########
@@ -203,7 +203,12 @@ def validate_gcs_path(self, view, arg_name):
if not self.is_full_string_match(self.GCS_BUCKET, bucket):
return self._validate_error(self.ERR_INVALID_GCS_BUCKET, arg, arg_name)
- if gcs_object is None or '\n' in gcs_object or '\r' in gcs_object:
+ if gcs_object is None:
+ return self._validate_error(
+ "Invalid GCS path: '%s' given for option: %s. "
+ "Did you mean: 'gs://%s/ or gs://some_bucket/%s'?",
+ arg, arg_name, bucket, bucket)
Review Comment:

The suggestion `gs://some_bucket/%s` is confusing because `some_bucket` is a placeholder name and not the user's actual bucket. If the user provided a bucket without a trailing slash (e.g., `gs://mybucket`), the most helpful and direct suggestion is simply to append a trailing slash (e.g., `gs://mybucket/`). We should simplify the error message to only suggest the trailing slash.
```suggestion
if gcs_object is None:
return self._validate_error(
"Invalid GCS path: '%s' given for option: %s. "
"Did you mean: 'gs://%s/'?",
arg, arg_name, bucket)
```
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Log temp/staging location options parsing errors. [beam]
Posted by "tvalentyn (via GitHub)" <gi...@apache.org>.
tvalentyn merged PR #39305:
URL: https://github.com/apache/beam/pull/39305
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Log temp/staging location options parsing errors. [beam]
Posted by "gemini-code-assist[bot] (via GitHub)" <gi...@apache.org>.
gemini-code-assist[bot] commented on PR #39305:
URL: https://github.com/apache/beam/pull/39305#issuecomment-4960159298
## Summary of Changes
Hello, I'm Gemini Code Assist[^1]! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request improves the observability and user experience of pipeline option validation. By logging specific errors for temp and staging locations and providing more descriptive feedback for invalid GCS paths, it helps users identify and resolve configuration issues more efficiently.
### Highlights
* **Improved Error Logging**: Added explicit logging for validation errors when temp or staging locations are incorrectly configured.
* **Enhanced GCS Path Validation**: Updated GCS path validation to provide clearer error messages and suggestions when the GCS object is missing.
<details>
<summary><b>New Features</b></summary>
🧠You can now enable **Memory** (public preview) to help **Gemini Code Assist** learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. **Click [here](https://codeassist.google/code-review/login) to enable Memory in your admin console.**
</details>
<details>
<summary><b>Using Gemini Code Assist</b></summary>
<br>
The full guide for Gemini Code Assist can be found on our [documentation page](https://developers.google.com/gemini-code-assist/docs/review-github-code), here are some quick tips.
<b>Invoking Gemini</b>
You can request assistance from Gemini at any point by creating a comment using either `/gemini <command>` or `@gemini-code-assist <command>`. Below is a summary of the supported commands on the current page.
Feature | Command | Description
--- | --- | ---
Code Review | `/gemini review` | Performs a code review for the current pull request in its current state.
Pull Request Summary | `/gemini summary` | Provides a summary of the current pull request in its current state.
Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help | `/gemini help` | Displays a list of available commands.
<b>Customization</b>
To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a `.gemini/` folder in the base of the repository. Detailed instructions can be found [here](https://developers.google.com/gemini-code-assist/docs/customize-gemini-behavior-github).
<b>Limitations & Feedback</b>
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with :thumbsup: and :thumbsdown: on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up [here](https://google.qualtrics.com/jfe/form/SV_2cyuGuTWsEw84yG).
</details>
[^1]: Review the [Privacy Notices](https://policies.google.com/privacy), [Generative AI Prohibited Use Policy](https://policies.google.com/terms/generative-ai/use-policy), [Terms of Service](https://policies.google.com/terms), and learn how to configure Gemini Code Assist in GitHub [here](https://developers.google.com/gemini-code-assist/docs/customize-gemini-behavior-github). Gemini can make mistakes, so double check it and [use code with caution](https://support.google.com/legal/answer/13505487).
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Log temp/staging location options parsing errors. [beam]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #39305:
URL: https://github.com/apache/beam/pull/39305#issuecomment-4961619394
Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control. If you'd like to restart, comment `assign set of reviewers`
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Log temp/staging location options parsing errors. [beam]
Posted by "tvalentyn (via GitHub)" <gi...@apache.org>.
tvalentyn commented on PR #39305:
URL: https://github.com/apache/beam/pull/39305#issuecomment-4961605856
R: @tarun-google
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Log temp/staging location options parsing errors. [beam]
Posted by "tarun-google (via GitHub)" <gi...@apache.org>.
tarun-google commented on PR #39305:
URL: https://github.com/apache/beam/pull/39305#issuecomment-4962149424
LGTM, Thank you
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org