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

[BEAM-9487] Disable allowing unsafe triggers by default #15340

Merged
merged 1 commit into from Aug 20, 2021

Conversation

zhoufek
Copy link
Contributor

@zhoufek zhoufek commented Aug 17, 2021

In the release notes for Beam 2.31, there were two deprecations mentioned that affect GroupByKey in the Python SDK:

* Python GBK will stop supporting unbounded PCollections that have global windowing and a default trigger in Beam 2.33. This can be overriden with `--allow_unsafe_triggers`. ([BEAM-9487](https://issues.apache.org/jira/browse/BEAM-9487)).
* Python GBK will start requiring safe triggers or the `--allow_unsafe_triggers` flag starting with Beam 2.33. ([BEAM-9487](https://issues.apache.org/jira/browse/BEAM-9487)).

This PR making that change in anticipation of the upcoming Beam 2.33 release.


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).
  • Format the pull request title like [BEAM-XXX] Fixes bug in ApproximateQuantiles, where you replace BEAM-XXX with the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.
  • Update CHANGES.md with noteworthy changes.

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

ValidatesRunner compliance status (on master branch)

Lang ULR Dataflow Flink Samza Spark Twister2
Go --- Build Status Build Status Build Status Build Status ---
Java Build Status Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Python --- Build Status
Build Status
Build Status
Build Status
Build Status
Build Status Build Status ---
XLang Build Status Build Status Build Status Build Status Build Status ---

Examples testing status on various runners

Lang ULR Dataflow Flink Samza Spark Twister2
Go --- --- --- --- --- --- ---
Java --- Build Status
Build Status
Build Status
--- --- --- --- ---
Python --- --- --- --- --- --- ---
XLang --- --- --- --- --- --- ---

Post-Commit SDK/Transform Integration Tests Status (on master branch)

Go Java Python
Build Status Build Status Build Status
Build Status
Build Status

Pre-Commit Tests Status (on master branch)

--- Java Python Go Website Whitespace Typescript
Non-portable Build Status
Build Status
Build Status
Build Status
Build Status
Build Status Build Status Build Status Build Status
Portable --- Build Status Build Status --- --- ---

See .test-infra/jenkins/README for trigger phrase, status and link of all Jenkins jobs.

GitHub Actions Tests Status (on master branch)

Build python source distribution and wheels
Python tests
Java tests

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

@zhoufek
Copy link
Contributor Author

zhoufek commented Aug 17, 2021

All test failures are from a known problem related to Panda and are unrelated to this change. Here's the test for reference, and it has a skip message calling this out:

def test_df_agg_method_invalid_kwarg_raises(self):

@zhoufek
Copy link
Contributor Author

zhoufek commented Aug 17, 2021

Should CHANGES.md be updated to mark this as deprecated in 2.32, or was marking it as deprecated in 2.31 good enough?

@zhoufek zhoufek marked this pull request as ready for review August 17, 2021 17:41
@zhoufek
Copy link
Contributor Author

zhoufek commented Aug 17, 2021

R: @aaltay

@aaltay aaltay requested a review from udim August 20, 2021 01:26
@@ -2332,22 +2332,19 @@ def expand(self, pcoll):

unsafe_reason = trigger.may_lose_data(windowing)
if unsafe_reason != DataLossReason.NO_POTENTIAL_LOSS:
reason_msg = str(unsafe_reason).replace('DataLossReason.', '')
if pcoll.pipeline.allow_unsafe_triggers:
Copy link
Member

Choose a reason for hiding this comment

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

Just double checking. Is this (pcoll.pipeline.allow_unsafe_triggers) correct? Would not it be something like pcoll.pipeline.options.allow_unsafe_triggers ?

Copy link
Contributor Author

@zhoufek zhoufek Aug 20, 2021

Choose a reason for hiding this comment

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

options is marked as deprecated with the message, "References to <pipeline>.options will not be supported."

For that reason, I added a property to access the option:

def allow_unsafe_triggers(self):

@aaltay
Copy link
Member

aaltay commented Aug 20, 2021

Should CHANGES.md be updated to mark this as deprecated in 2.32, or was marking it as deprecated in 2.31 good enough?

Yes, please also update the changes.md file for 2.33.0 (or whichever the release this will be part of).

@zhoufek
Copy link
Contributor Author

zhoufek commented Aug 20, 2021

Updated CHANGES.md to both call out the deprecation in 2.32 and note the breaking change for 2.33.

@codecov
Copy link

codecov bot commented Aug 20, 2021

Codecov Report

Merging #15340 (706e20f) into master (b0e9f26) will decrease coverage by 0.12%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #15340      +/-   ##
==========================================
- Coverage   83.81%   83.68%   -0.13%     
==========================================
  Files         440      440              
  Lines       59795    60292     +497     
==========================================
+ Hits        50116    50458     +342     
- Misses       9679     9834     +155     
Impacted Files Coverage Δ
...dks/python/apache_beam/options/pipeline_options.py 95.16% <ø> (ø)
sdks/python/apache_beam/transforms/core.py 92.02% <100.00%> (+<0.01%) ⬆️
sdks/python/apache_beam/io/gcp/bigquery.py 73.98% <0.00%> (-2.40%) ⬇️
...apache_beam/runners/portability/portable_runner.py 76.14% <0.00%> (-1.76%) ⬇️
sdks/python/apache_beam/io/source_test_utils.py 88.47% <0.00%> (-1.39%) ⬇️
...hon/apache_beam/runners/worker/bundle_processor.py 93.51% <0.00%> (-0.13%) ⬇️
setup.py 0.00% <0.00%> (ø)
sdks/python/apache_beam/transforms/trigger.py 89.61% <0.00%> (+0.34%) ⬆️
sdks/python/apache_beam/runners/direct/executor.py 96.79% <0.00%> (+0.53%) ⬆️
sdks/python/apache_beam/io/localfilesystem.py 92.24% <0.00%> (+0.77%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b0e9f26...706e20f. Read the comment docs.

Copy link
Member

@udim udim left a comment

Choose a reason for hiding this comment

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

@aaltay
Copy link
Member

aaltay commented Aug 20, 2021

@aaltay
Copy link
Member

aaltay commented Aug 20, 2021

Run Python PreCommit

@udim udim merged commit cf8e08f into apache:master Aug 20, 2021
@zhoufek zhoufek deleted the gbk_233 branch September 3, 2021 01:05
@zhoufek zhoufek restored the gbk_233 branch September 28, 2021 01:12
@zhoufek zhoufek deleted the gbk_233 branch September 28, 2021 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants