beam icon indicating copy to clipboard operation
beam copied to clipboard

Add initial read_gbq wrapper

Open svetakvsundhar opened this issue 2 years ago • 3 comments

Part of #20810

This PR adds a wrapper function 'read_gbq', that wraps a wrapper PTransform 'ReadGbq'. 'ReadGbq' allows users to Read from BQ, convert the schema into a Beam Schema, and plumb into a Deferred Dataframe.


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

  • [x] Choose reviewer(s) and mention them in a comment (R: @username).
  • [ ] 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.

svetakvsundhar avatar Aug 06 '22 19:08 svetakvsundhar

Codecov Report

Merging #22616 (3d17f62) into master (720ee14) will increase coverage by 0.02%. The diff coverage is 94.44%.

@@            Coverage Diff             @@
##           master   #22616      +/-   ##
==========================================
+ Coverage   74.23%   74.26%   +0.02%     
==========================================
  Files         707      710       +3     
  Lines       93295    93885     +590     
==========================================
+ Hits        69257    69719     +462     
- Misses      22770    22898     +128     
  Partials     1268     1268              
Flag Coverage Δ
python 83.57% <94.44%> (-0.05%) :arrow_down:

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

Impacted Files Coverage Δ
sdks/python/apache_beam/dataframe/io.py 89.53% <94.44%> (+0.75%) :arrow_up:
sdks/python/apache_beam/typehints/__init__.py 77.77% <0.00%> (-22.23%) :arrow_down:
.../python/apache_beam/testing/test_stream_service.py 88.09% <0.00%> (-4.77%) :arrow_down:
...examples/inference/sklearn_mnist_classification.py 43.75% <0.00%> (-3.75%) :arrow_down:
sdks/python/apache_beam/utils/subprocess_server.py 56.54% <0.00%> (-2.20%) :arrow_down:
...n/apache_beam/ml/gcp/recommendations_ai_test_it.py 73.46% <0.00%> (-2.05%) :arrow_down:
...che_beam/runners/interactive/interactive_runner.py 90.06% <0.00%> (-1.33%) :arrow_down:
sdks/python/apache_beam/runners/direct/executor.py 96.46% <0.00%> (-0.55%) :arrow_down:
sdks/python/apache_beam/typehints/schemas.py 93.84% <0.00%> (-0.48%) :arrow_down:
sdks/python/apache_beam/coders/coders.py 88.00% <0.00%> (-0.35%) :arrow_down:
... and 32 more

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

codecov[bot] avatar Aug 06 '22 20:08 codecov[bot]

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

R: @pabloem for label python. R: @johnjcasey 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).

github-actions[bot] avatar Aug 06 '22 21:08 github-actions[bot]

R: @TheNeuralBit this is ready for an initial pass, PTAL.

svetakvsundhar avatar Aug 07 '22 23:08 svetakvsundhar

Thanks for the suggestions @TheNeuralBit , I think this is ready for another pass.

svetakvsundhar avatar Aug 12 '22 19:08 svetakvsundhar

Run Python_PVR_Flink PreCommit

svetakvsundhar avatar Aug 12 '22 20:08 svetakvsundhar

Run Python 3.8 PostCommit

TheNeuralBit avatar Aug 12 '22 23:08 TheNeuralBit

Run Python 3.8 PostCommit

svetakvsundhar avatar Aug 24 '22 19:08 svetakvsundhar

Run Python PreCommit

svetakvsundhar avatar Aug 24 '22 21:08 svetakvsundhar

Thanks @TheNeuralBit ! Ive addressed changes, ptal. I've also verified that the new IT's are running.

Screen Shot 2022-08-24 at 4 01 22 PM

svetakvsundhar avatar Aug 24 '22 22:08 svetakvsundhar

Run Python 3.8 PostCommit

svetakvsundhar avatar Aug 27 '22 21:08 svetakvsundhar

thanks! changes made

svetakvsundhar avatar Aug 29 '22 17:08 svetakvsundhar

Run Python 3.8 PostCommit

svetakvsundhar avatar Aug 31 '22 18:08 svetakvsundhar

Run Python PreCommit

svetakvsundhar avatar Aug 31 '22 20:08 svetakvsundhar

@TheNeuralBit ptal and lmk if the io_it_test looks viable

svetakvsundhar avatar Aug 31 '22 21:08 svetakvsundhar

Run Python PreCommit

TheNeuralBit avatar Aug 31 '22 21:08 TheNeuralBit

@TheNeuralBit ptal and lmk if the io_it_test looks viable

Looks great! I can merge when we get CI green

TheNeuralBit avatar Aug 31 '22 21:08 TheNeuralBit

Run Python PreCommit

svetakvsundhar avatar Sep 01 '22 00:09 svetakvsundhar

Run Python PreCommit

svetakvsundhar avatar Sep 01 '22 14:09 svetakvsundhar