Skip to content

Conversation

@svetakvsundhar
Copy link
Contributor

Issue: #22909

This PR adds support for the TIMESTAMP time from BigQuery, and maps it to a BEAM_ROW type. This will be supported in Python's BigQuery IO implementation, as well as read_gbq.


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

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

@codecov
Copy link

codecov bot commented Sep 7, 2022

Codecov Report

Merging #23070 (1b15491) into master (25c6ed7) will decrease coverage by 0.26%.
The diff coverage is 57.14%.

@@            Coverage Diff             @@
##           master   #23070      +/-   ##
==========================================
- Coverage   73.67%   73.41%   -0.27%     
==========================================
  Files         714      719       +5     
  Lines       95220    95691     +471     
==========================================
+ Hits        70154    70248      +94     
- Misses      23769    24146     +377     
  Partials     1297     1297              
Flag Coverage Δ
python 83.04% <57.14%> (-0.45%) ⬇️

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

Impacted Files Coverage Δ
...python/apache_beam/io/gcp/bigquery_schema_tools.py 77.55% <57.14%> (-6.54%) ⬇️
sdks/python/apache_beam/io/gcp/bigquery_tools.py 73.34% <0.00%> (-12.39%) ⬇️
...s/interactive/dataproc/dataproc_cluster_manager.py 71.72% <0.00%> (-5.70%) ⬇️
.../python/apache_beam/testing/test_stream_service.py 88.09% <0.00%> (-4.77%) ⬇️
sdks/python/apache_beam/internal/pickler.py 92.00% <0.00%> (-3.46%) ⬇️
sdks/python/apache_beam/io/gcp/bigquery.py 71.31% <0.00%> (-2.94%) ⬇️
sdks/python/apache_beam/internal/gcp/json_value.py 85.50% <0.00%> (-2.90%) ⬇️
...on/apache_beam/runners/dataflow/dataflow_runner.py 80.80% <0.00%> (-2.20%) ⬇️
sdks/python/apache_beam/typehints/schemas.py 91.89% <0.00%> (-1.96%) ⬇️
... and 62 more

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

@github-actions
Copy link
Contributor

github-actions bot commented Sep 8, 2022

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

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

@tvalentyn
Copy link
Contributor

Run Python 3.8 PostCommit

@tvalentyn
Copy link
Contributor

will defer to @ahmedabu98 for the review assuming tests pass.

@svetakvsundhar
Copy link
Contributor Author

whoops, i didnt realize the reviewer would be auto-assigned.

anyways, this integration test will fail with AttributeError: 'datetime.datetime' object has no attribute 'micros' [while running 'ReadFromBigQuery/ParDo(BeamSchemaConversionDoFn)']

I wanted to ask, should apache_beam.utils.timestamp be using TimestampCoder? Looks like it's using RowCoder now.

@svetakvsundhar
Copy link
Contributor Author

cc: @TheNeuralBit

Copy link
Contributor

@ahmedabu98 ahmedabu98 left a comment

Choose a reason for hiding this comment

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

Thanks @svetakvsundhar, left a couple comments

@github-actions
Copy link
Contributor

Reminder, please take a look at this pr: @tvalentyn @ahmedabu98

@github-actions
Copy link
Contributor

Assigning new set of reviewers because Pr has gone too long without review. If you would like to opt out of this review, comment assign to next reviewer:

R: @y1chi 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)

@tvalentyn
Copy link
Contributor

waiting on author

@svetakvsundhar
Copy link
Contributor Author

Run Python 3.7 PostCommit

@github-actions
Copy link
Contributor

Reminder, please take a look at this pr: @y1chi @johnjcasey

@svetakvsundhar
Copy link
Contributor Author

Thanks all for the suggestions. Because the BQ Timestamp object was actually a datetime.datetime, we needed to modify the conversion ParDo logic to convert into an apache_beam_utils.timestamp.Timestamp

@svetakvsundhar
Copy link
Contributor Author

Run Python 3.7 PostCommit

@svetakvsundhar
Copy link
Contributor Author

Run Python PreCommit

@svetakvsundhar
Copy link
Contributor Author

Run Python 3.7 PostCommit

@svetakvsundhar svetakvsundhar requested review from ahmedabu98 and tvalentyn and removed request for ahmedabu98 and tvalentyn October 19, 2022 15:09
@ahmedabu98
Copy link
Contributor

Run Python 3.8 PostCommit

@tvalentyn
Copy link
Contributor

@AnandInguva is looking into py3.10 issue, looks unrelated, py3.8 has bq tests and should provide sufficient coverage, not sure why py3.7 failed, looks like infra error

@tvalentyn
Copy link
Contributor

other errors:
apache_beam.runners.portability.fn_api_runner.fn_runner_test.FnApiRunnerTestWithGrpcAndMultiWorkers.test_batch_pardo_trigger_flush --> #21104
apache_beam.runners.portability.portable_runner_test.PortableRunnerTestWithExternalEnv.test_pardo_large_input -> #22321

@ahmedabu98
Copy link
Contributor

Py37 postcommits have been consistently timing out: Build timed out (after 240 minutes). Marking the build as aborted.

@ahmedabu98
Copy link
Contributor

Py38 more reliable as it isn't responsible for as many tests as Py37

Copy link
Contributor

@ahmedabu98 ahmedabu98 left a comment

Choose a reason for hiding this comment

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

This LGTM, let's wait for Py38 Postcommits though

@svetakvsundhar
Copy link
Contributor Author

sg, looks like 3.7 ran the tests in question
Screen Shot 2022-10-19 at 2 41 37 PM

@tvalentyn
Copy link
Contributor

Py37 postcommits have been consistently timing out: Build timed out (after 240 minutes). Marking the build as aborted.

This is strange, I have increased the timeout in: #23595

@tvalentyn tvalentyn merged commit 61b8677 into apache:master Oct 19, 2022
@svetakvsundhar svetakvsundhar deleted the timestamp_branch branch October 19, 2022 22:21
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.

5 participants