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

Remove obsolete and deprecated bigquery native write. #23557 #23558

Merged
merged 9 commits into from
Oct 12, 2022

Conversation

robertwb
Copy link
Contributor


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.

@github-actions
Copy link
Contributor

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

R: @ryanthompson591 for label python.

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

@robertwb robertwb changed the title Avoid re-writing BigQuery writes with obsolete native write. Remove obsolete and deprecated bigquery native write. #23557 Oct 10, 2022
@robertwb
Copy link
Contributor Author

R: @Abacn
CC: @pabloem

@github-actions
Copy link
Contributor

Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control

@pabloem
Copy link
Member

pabloem commented Oct 10, 2022

Run Python PostCommit

@pabloem
Copy link
Member

pabloem commented Oct 10, 2022

nice! LGTM

@pabloem
Copy link
Member

pabloem commented Oct 10, 2022

Run Python 3.8 PostCommit

@@ -1410,7 +1410,7 @@ def __next__(self):


@deprecated(since='2.11.0', current="WriteToBigQuery")
class BigQuerySink(*args, **kwargs):
def BigQuerySink(*args, **kwargs):
Copy link
Contributor

Choose a reason for hiding this comment

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

Why change this from class to def?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This way one can still do io.Write(BigQuerySink(...)) even though the old class is gone.

Copy link
Contributor

@ryanthompson591 ryanthompson591 left a comment

Choose a reason for hiding this comment

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

This is great if it works the way it looks like it does.

I didn't dig deep into making sure that having the deprecated class fall back to the new class works seamlessly. Ideally, if you can write some tests to make sure that is the case, this should be fine.

sink=self,
test_bigquery_client=test_bigquery_client,
buffer_size=buffer_size)
def BigQuerySink(*args, **kwargs):
Copy link
Contributor

Choose a reason for hiding this comment

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

If it makes sense, add a test to make sure this fallback works.

Since any code calling the fallback will expect the same interface as the deprecated BigQuerySink right? Is the interface exactly the same, or could users get runtime errors in unexpected places?

If there are unexpected runtime errors consider fully sunsetting instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, this is intended to be a drop-in replacement, with the old variant deprecated over two years ago.

CHANGES.md Outdated
@@ -62,6 +62,7 @@
* Decreased TextSource CPU utilization by 2.3x (Java) ([#23193](https://github.com/apache/beam/issues/23193)).
* Fixed bug when using SpannerIO with RuntimeValueProvider options (Java) ([#22146](https://github.com/apache/beam/issues/22146)).
* Fixed issue for unicode rendering on WriteToBigQuery ([#10785](https://github.com/apache/beam/issues/10785))
* Remove obsolete variant of BigQuery Write ([#23564](https://github.com/apache/beam/issues/23564)).
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe comment that old code using this variant will redirect to the new variant with a warning. This isn't a breaking change right?

Copy link
Contributor

Choose a reason for hiding this comment

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

The same line added in #23557 introduces a conflict. Could just change this line to

Remove obsolete variant of BigQuery Read and Write ([#23559](https://github.com/apache/beam/issues/23559)).

during rebase.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I merged these lines in the changelog.

@codecov
Copy link

codecov bot commented Oct 11, 2022

Codecov Report

Merging #23558 (0c48d23) into master (3ffdf8d) will decrease coverage by 0.07%.
The diff coverage is 87.50%.

@@            Coverage Diff             @@
##           master   #23558      +/-   ##
==========================================
- Coverage   73.40%   73.32%   -0.08%     
==========================================
  Files         719      719              
  Lines       95940    95791     -149     
==========================================
- Hits        70424    70239     -185     
- Misses      24205    24241      +36     
  Partials     1311     1311              
Flag Coverage Δ
python 83.04% <87.50%> (-0.10%) ⬇️

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_tools.py 73.30% <ø> (-3.32%) ⬇️
...ache_beam/runners/dataflow/ptransform_overrides.py 90.90% <ø> (+0.78%) ⬆️
...on/apache_beam/runners/dataflow/dataflow_runner.py 80.88% <75.00%> (-2.52%) ⬇️
sdks/python/apache_beam/io/gcp/bigquery.py 71.31% <100.00%> (-1.85%) ⬇️
.../python/apache_beam/testing/test_stream_service.py 88.09% <0.00%> (-4.77%) ⬇️
.../python/apache_beam/transforms/periodicsequence.py 98.38% <0.00%> (-1.62%) ⬇️
...che_beam/runners/interactive/interactive_runner.py 90.50% <0.00%> (-1.27%) ⬇️
sdks/python/apache_beam/pipeline.py 92.25% <0.00%> (-0.60%) ⬇️
... and 3 more

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

@robertwb
Copy link
Contributor Author

Unrelated timeout in apache_beam.transforms.userstate_test.StatefulDoFnOnDirectRunnerTest.test_dynamic_timer_clear_then_set_timer

@robertwb robertwb merged commit 6adecd4 into apache:master Oct 12, 2022
robertwb added a commit to robertwb/incubator-beam that referenced this pull request Oct 21, 2022
ruslan-ikhsan pushed a commit to akvelon/beam that referenced this pull request Nov 11, 2022
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.

4 participants