Improve BigQueryIO Storage Write API error messages#38948
Conversation
* Surface the root cause in the RuntimeException when AppendRows retries are exhausted. * Elevate the final failure logging to ERROR level. * Provide actionable advice for PERMISSION_DENIED and NOT_FOUND errors, suggesting to check if the destination table exists and if the service account has the TABLES_UPDATE_DATA permission. * Add a unit test to verify the improved error messages on retry exhaustion.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request improves error reporting when BigQuery Storage API write retries are exhausted. It enhances error messages with the last encountered error and provides specific hints for PERMISSION_DENIED and NOT_FOUND status codes (e.g., checking permissions and table existence). These changes are applied to both sharded and unsharded record writers, and a new unit test is added to verify this behavior. Feedback on the changes highlights potential NullPointerException risks when comparing the statusCode enum using .equals(). It is recommended to use the == operator instead, which is null-safe and standard practice for enum comparisons in Java.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request improves error reporting when BigQuery Storage API write retries are exhausted by appending actionable troubleshooting advice for PERMISSION_DENIED and NOT_FOUND errors, and adds a unit test to verify this behavior. The review feedback suggests removing duplicate logging before throwing exceptions to avoid cluttered logs, preserving the full exception chain rather than discarding the outer exception, and simplifying the status code extraction.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
…tion, and preserve exception chain
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request improves error messages when BigQuery Storage API writes fail after exhausting retries by including the last encountered error and suggesting permission checks for PERMISSION_DENIED and NOT_FOUND statuses. The review feedback recommends handling InterruptedException properly in StorageApiWritesShardedRecords to avoid swallowing the interrupt status, and updating the referenced IAM permission to the official 'bigquery.tables.updateData' name across the codebase and tests.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
…icial IAM permission name
…mission name in source files
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request improves error reporting in BigQuery Storage API writes (both sharded and unsharded records) when retries are exhausted. It enhances the error messages to include the last encountered error and, for PERMISSION_DENIED or NOT_FOUND status codes, adds actionable advice to check table existence and service account permissions. It also introduces a unit test to verify this behavior using a simulated append failure in FakeDatasetService. I have no feedback to provide as there are no review comments.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
R: @ahmedabu98 |
|
Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control. If you'd like to restart, comment |
Summary of ChangesHello, I'm Gemini Code Assist1! 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 significantly enhances the debugging experience for users of the BigQuery Storage Write API by providing more descriptive and actionable error messages. When AppendRows operations fail after exhausting retries or encountering persistent issues, the system will now output detailed information, including the last error encountered and specific guidance on common problems like incorrect permissions or missing tables. This change aims to reduce the time and effort required to diagnose and resolve write failures. Highlights
New Features🧠 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 to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization 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 Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 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. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request improves error reporting for BigQuery Storage API writes by appending the last encountered error and helpful troubleshooting instructions (such as checking table existence and permissions) to the exception message when AppendRows fails. It also adds a unit test to verify this behavior. The reviewer suggested simplifying the error message in the sharded write path from "More than %d attempts to call AppendRows failed" to "AppendRows failed" because persistent errors can cause immediate failure on the first attempt, making the original message misleading. A corresponding update to the test assertions was also recommended.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Summary of ChangesHello, I'm Gemini Code Assist1! 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 developer experience when working with the BigQuery Storage Write API by providing more actionable error messages. By capturing and surfacing the last encountered error and offering specific troubleshooting advice for common permission and configuration issues, it helps users diagnose and resolve failures more efficiently when retries are exhausted. Highlights
New Features🧠 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 to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization 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 Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 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. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request improves error reporting when BigQuery Storage API write retries are exhausted by including the last encountered error and adding actionable troubleshooting hints for PERMISSION_DENIED and NOT_FOUND errors. The reviewer suggests extracting the duplicated error message formatting logic between StorageApiWriteUnshardedRecords and StorageApiWritesShardedRecords into a shared helper method to improve maintainability.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
Warning Gemini encountered an error creating the summary. You can try again by commenting |
This PR improves the error messages thrown by the BigQuery Storage Write API (both sharded and unsharded paths) when retries are exhausted or when persistent errors are encountered.