Repository navigation
Fix bigquery_tools_test to mock gcp_bigquery library instead... - #40676
Conversation
There was a problem hiding this comment.
📋 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_storageis mocked in the same test class.
💡 Tip: Comment /gemini review on this pull request to trigger a new Gemini code review.
Codecov Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Assigning reviewers: R: @tvalentyn for label python. Note: If you would like to opt out of this review, comment Available commands:
The PR bot will only process comments in the main thread (not review comments). |
of gcp_bigquery.Client.
gcp_bigquery null so mocking it's usage can result in 'AttributeError':
beam/sdks/python/apache_beam/io/gcp/bigquery_tools.py
Line 82 in 0c37058