Skip to content

impl(bigquery): add row parsing errors#5917

Merged
alvarowolfx merged 3 commits into
googleapis:mainfrom
alvarowolfx:impl-bq-row-err
Jun 22, 2026
Merged

impl(bigquery): add row parsing errors#5917
alvarowolfx merged 3 commits into
googleapis:mainfrom
alvarowolfx:impl-bq-row-err

Conversation

@alvarowolfx

Copy link
Copy Markdown
Contributor

Towards #5844

@alvarowolfx alvarowolfx requested a review from a team as a code owner June 18, 2026 16:04
@product-auto-label product-auto-label Bot added the api: bigquery Issues related to the BigQuery API. label Jun 18, 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 the RowError and ConvertError enums to handle failures when retrieving and converting BigQuery row values, along with comprehensive unit tests for their display formatting. The feedback suggests expanding the documentation for RowError to clarify that it can also represent errors occurring during query result iteration due to its Rpc variant.

Comment thread src/bigquery/src/error.rs Outdated
@codecov

codecov Bot commented Jun 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.90%. Comparing base (26baa31) to head (3b5f25c).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5917   +/-   ##
=======================================
  Coverage   97.90%   97.90%           
=======================================
  Files         234      234           
  Lines       59451    59487   +36     
=======================================
+ Hits        58205    58243   +38     
+ Misses       1246     1244    -2     

☔ 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.

Comment thread src/bigquery/src/error.rs
pub enum ConvertError {
/// The value type did not match the expected type.
#[error("type mismatch, expected {expected}, got {got:?}")]
TypeMismatch {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Q: what is the difference between TypeMismatch and Convert ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

TypeMismatch is an error for when the value coming under the hood is not what we expect (like we expect a TIMESTAMP column to be a int64 in String format, but if we get another format, we don't even try to parse and raise TypeMismatch.

Convert is when the types are correct, but when actually trying to parse, it fails. Maybe we are parsing a INTEGER, which is expected to come as String, it comes like that, but inside the string there is a non integer value.

So TypeMismatch doesn't even try to parse as the types are incorrect and Convert is that the types match, but parsing failed.

@alvarowolfx alvarowolfx merged commit 75c4db2 into googleapis:main Jun 22, 2026
40 checks passed
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.

2 participants