Skip to content

Fix bigquery_tools_test to mock gcp_bigquery library instead... - #40676

Merged
chamikaramj merged 1 commit into
apache:masterfrom
chamikaramj:bq_tools_test_fix
Oct 20, 2026
Merged

chamikaramj merged 1 commit into
apache:masterfrom
chamikaramj:bq_tools_test_fix

Conversation

@chamikaramj

Copy link
Copy Markdown
Contributor

of gcp_bigquery.Client.

gcp_bigquery null so mocking it's usage can result in 'AttributeError':

@github-actions github-actions 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.

📋 Review Summary

This PR updates TestBigQueryWrapperQuotaProject in bigquery_tools_test.py to patch apache_beam.io.gcp.bigquery_tools.gcp_bigquery instead of gcp_bigquery.Client. This prevents an AttributeError during test collection/execution in environments where google-cloud-bigquery is not installed and gcp_bigquery is None.

🔍 General Feedback

  • The change is clean, minimal, and consistent with how bq_storage is mocked in the same test class.

💡 Tip: Comment /gemini review on this pull request to trigger a new Gemini code review.

@codecov

codecov Bot commented Oct 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.01%. Comparing base (76f6e6d) to head (86ea08c).
⚠️ Report is 242 commits behind head on master.

Additional details and impacted files
@@              Coverage Diff              @@
##             master   #40676       +/-   ##
=============================================
+ Coverage     56.16%   80.01%   +23.85%     
=============================================
  Files          1124      490      -634     
  Lines        178336    82811    -95525     
  Branches       1489        0     -1489     
=============================================
- Hits         100170    66265    -33905     
+ Misses        75645    16546    -59099     
+ Partials       2521        0     -2521     
Flag Coverage Δ
go ?
java ?
python 80.01% <ø> (+0.46%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

Copy link
Copy Markdown
Contributor

Assigning reviewers:

R: @tvalentyn for label python.
Backup reviewer: shunping (if the main reviewer is unresponsive, you can escalate to them by tagging their username)

Note: If you would like to opt out of this review, comment assign to next reviewer.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

The PR bot will only process comments in the main thread (not review comments).

@chamikaramj
chamikaramj merged commit 8a9afdc into apache:master Oct 20, 2026
86 checks passed
@chamikaramj
chamikaramj deleted the bq_tools_test_fix branch October 20, 2026 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants