Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use PipelineOptions for constructing BigQueryWrapper when estimating BigQuery table size (#26622) #26662

Merged
merged 3 commits into from
May 31, 2023

Conversation

dopieralad
Copy link
Contributor

This Pull Request addresses issue #26622.

Changes made:

  1. Added factory method to BigQueryWrapper that allows for specifying PipelineOptions for which the Google Cloud Platform credentials are retrieved for the underlying BigQuery client,
  2. Passed appropriate PipelineOptions to BigQueryWrapper when estimating BigQuery table size.

Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Mention the appropriate issue in your description (for example: addresses #123), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, comment fixes #<ISSUE NUMBER> instead.
  • Update CHANGES.md with noteworthy changes.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.

To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md

GitHub Actions Tests Status (on master branch)

Build python source distribution and wheels
Python tests
Java tests
Go tests

See CI.md for more information about GitHub Actions CI.

@dopieralad dopieralad changed the title Add BigQueryWrapper factory method with PipelineOptions (#26622) Use PipelineOptions in BigQueryWrapper when estimating _BigQuery_ table size (#26622) May 11, 2023
@dopieralad dopieralad changed the title Use PipelineOptions in BigQueryWrapper when estimating _BigQuery_ table size (#26622) Use PipelineOptions for constructing BigQueryWrapper when estimating BigQuery table size (#26622) May 11, 2023
@dopieralad dopieralad marked this pull request as ready for review May 19, 2023 12:34
@github-actions
Copy link
Contributor

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

R: @riteshghorse for label python.
R: @Abacn for label io.

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

Copy link
Contributor

@Abacn Abacn left a comment

Choose a reason for hiding this comment

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

Thanks for the catch!

@Abacn
Copy link
Contributor

Abacn commented May 19, 2023

For the Format check fail, run this command to fix:

# Run from root beam repo dir
pip install yapf==0.29.0
git diff HEAD^ --name-only | grep "\.py$" | xargs yapf --in-place

@Abacn
Copy link
Contributor

Abacn commented May 19, 2023

waiting on author

@codecov
Copy link

codecov bot commented May 30, 2023

Codecov Report

Merging #26662 (77c2b02) into master (86f56e9) will decrease coverage by 0.14%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master   #26662      +/-   ##
==========================================
- Coverage   72.06%   71.93%   -0.14%     
==========================================
  Files         745      747       +2     
  Lines      101200   101467     +267     
==========================================
+ Hits        72930    72986      +56     
- Misses      26810    27021     +211     
  Partials     1460     1460              
Flag Coverage Δ
python 80.86% <100.00%> (-0.24%) ⬇️

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

Impacted Files Coverage Δ
sdks/python/apache_beam/io/gcp/bigquery.py 69.74% <100.00%> (ø)
sdks/python/apache_beam/io/gcp/bigquery_tools.py 74.82% <100.00%> (+0.20%) ⬆️

... and 17 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@dopieralad
Copy link
Contributor Author

I've reformatted the code as you suggested 🙂

@Abacn
Copy link
Contributor

Abacn commented May 30, 2023

Run Python_Runners PreCommit

@Abacn Abacn merged commit 018d626 into apache:master May 31, 2023
@Abacn
Copy link
Contributor

Abacn commented May 31, 2023

Thank you!

Dippatel98 pushed a commit to Dippatel98/beam that referenced this pull request Jun 5, 2023
…ing BigQuery table size (apache#26622) (apache#26662)

* Add `BigQueryWrapper` factory method with `PipelineOptions` (apache#26622)

* Pass `PipelineOptions` to `BigQueryWrapper` when estimating table size (apache#26622)

* Reformat `bigquery_tools.py` (apache#26622)
scwhittle pushed a commit to scwhittle/beam that referenced this pull request Jun 8, 2023
…ing BigQuery table size (apache#26622) (apache#26662)

* Add `BigQueryWrapper` factory method with `PipelineOptions` (apache#26622)

* Pass `PipelineOptions` to `BigQueryWrapper` when estimating table size (apache#26622)

* Reformat `bigquery_tools.py` (apache#26622)
bullet03 pushed a commit to akvelon/beam that referenced this pull request Aug 11, 2023
…ing BigQuery table size (apache#26622) (apache#26662)

* Add `BigQueryWrapper` factory method with `PipelineOptions` (apache#26622)

* Pass `PipelineOptions` to `BigQueryWrapper` when estimating table size (apache#26622)

* Reformat `bigquery_tools.py` (apache#26622)
cushon pushed a commit to cushon/beam that referenced this pull request May 24, 2024
…ing BigQuery table size (apache#26622) (apache#26662)

* Add `BigQueryWrapper` factory method with `PipelineOptions` (apache#26622)

* Pass `PipelineOptions` to `BigQueryWrapper` when estimating table size (apache#26622)

* Reformat `bigquery_tools.py` (apache#26622)
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