Skip to content

impl(bigquery): parse numeric types as decimal#6044

Merged
alvarowolfx merged 5 commits into
googleapis:mainfrom
alvarowolfx:impl-bq-from-sql-nums
Jul 16, 2026
Merged

impl(bigquery): parse numeric types as decimal#6044
alvarowolfx merged 5 commits into
googleapis:mainfrom
alvarowolfx:impl-bq-from-sql-nums

Conversation

@alvarowolfx

Copy link
Copy Markdown
Contributor

Towards #5844

@product-auto-label product-auto-label Bot added the api: bigquery Issues related to the BigQuery API. label Jul 13, 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 implements the FromSql trait for i32, f32, google_cloud_type::model::Decimal, and rust_decimal::Decimal in the BigQuery crate, accompanied by comprehensive unit and integration tests. The review feedback recommends using standard FromStr parsing via str::parse instead of rust_decimal::Decimal::from_str_exact to ensure robust handling of scientific notation and formatting variations.

Comment thread src/bigquery/src/query/from_sql.rs Outdated
@alvarowolfx

Copy link
Copy Markdown
Contributor Author

/gemini review

@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 implements the FromSql trait for i32, f32, google_cloud_type::model::Decimal, and rust_decimal::Decimal to expand support for numeric types in BigQuery queries, accompanied by comprehensive unit and integration tests. The feedback suggests optimizing the FromSql implementation for rust_decimal::Decimal by avoiding intermediate string allocations and parsing when converting from serde_json::Number, recommending direct numeric conversions instead.

Comment thread src/bigquery/src/query/from_sql.rs
@codecov

codecov Bot commented Jul 13, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.79412% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 97.04%. Comparing base (e0ead5f) to head (c8d1510).

Files with missing lines Patch % Lines
src/bigquery/src/query/from_sql.rs 96.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6044      +/-   ##
==========================================
+ Coverage   97.02%   97.04%   +0.01%     
==========================================
  Files         253      253              
  Lines       63547    63682     +135     
==========================================
+ Hits        61655    61798     +143     
+ Misses       1892     1884       -8     

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

@alvarowolfx
alvarowolfx marked this pull request as ready for review July 13, 2026 20:10
@alvarowolfx
alvarowolfx requested a review from a team as a code owner July 13, 2026 20:10
Comment thread src/bigquery/src/query/from_sql.rs
Comment thread src/bigquery/src/query/from_sql.rs Outdated
@alvarowolfx
alvarowolfx merged commit 2f59820 into googleapis:main Jul 16, 2026
41 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