Skip to content

impl(bigquery): validate table format for writes - #6253

Open
dbolduc wants to merge 2 commits into
googleapis:mainfrom
dbolduc:bq-arrow-writer-builder-validate-binding
Open

impl(bigquery): validate table format for writes#6253
dbolduc wants to merge 2 commits into
googleapis:mainfrom
dbolduc:bq-arrow-writer-builder-validate-binding

Conversation

@dbolduc

@dbolduc dbolduc commented Jul 31, 2026

Copy link
Copy Markdown
Member

While the binding code may look unreasonably complicated, it produced this error for the existing (incorrect) unit test:

Error: cannot find a matching binding to send the request: field `table` should match the template: 'projects/*/datasets/*/tables/*'; found: 'projects/p/tables/t'

Fixes #6249

@product-auto-label product-auto-label Bot added the api: bigquery Issues related to the BigQuery API. label Jul 31, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces table format validation to the WriterBuilder::default method using gaxi path matching, and adds parameterized unit tests using the test-case crate to verify both valid and invalid table formats. The feedback suggests extracting the duplicated Segment array in the validate_table function into a local slice variable to improve readability and prevent future maintenance issues.

Comment thread src/bigquery-write/src/arrow/writer_builder.rs
@dbolduc
dbolduc marked this pull request as ready for review July 31, 2026 21:30
@dbolduc
dbolduc requested a review from a team as a code owner July 31, 2026 21:30
@codecov

codecov Bot commented Jul 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.07%. Comparing base (0dac6ea) to head (eba8ad0).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6253   +/-   ##
=======================================
  Coverage   96.07%   96.07%           
=======================================
  Files         275      275           
  Lines       68829    68861   +32     
=======================================
+ Hits        66126    66161   +35     
+ Misses       2703     2700    -3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: bigquery Issues related to the BigQuery API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BigQuery Write: Locally validate table resource

1 participant