3636from apache_beam .options .pipeline_options import DebugOptions
3737from apache_beam .options .pipeline_options import PortableOptions
3838from apache_beam .options .pipeline_options import StandardOptions
39+ from apache_beam .options .pipeline_options import TypeOptions
3940from apache_beam .runners .portability import portable_runner_test
4041from apache_beam .runners .portability import prism_runner
4142from apache_beam .testing .util import assert_that
@@ -68,6 +69,7 @@ def __init__(self, *args, **kwargs):
6869 self .environment_config = None
6970 self .enable_commit = False
7071 self .streaming = False
72+ self .allow_unsafe_triggers = False
7173
7274 def setUp (self ):
7375 self .enable_commit = False
@@ -180,6 +182,8 @@ def create_options(self):
180182 PortableOptions ).environment_options = self .environment_options
181183
182184 options .view_as (StandardOptions ).streaming = self .streaming
185+ options .view_as (
186+ TypeOptions ).allow_unsafe_triggers = self .allow_unsafe_triggers
183187 return options
184188
185189 # Can't read host files from within docker, read a "local" file there.
@@ -234,6 +238,7 @@ def construct_timestamped(k, t):
234238 return window .TimestampedValue ((k , t ), t )
235239
236240 def test_after_count_trigger_batch (self ):
241+ self .allow_unsafe_triggers = True
237242 with self .create_pipeline () as p :
238243 result = (
239244 p
@@ -257,6 +262,7 @@ def test_after_count_trigger_batch(self):
257262 # yapf: enable
258263
259264 def test_after_count_trigger_streaming (self ):
265+ self .allow_unsafe_triggers = True
260266 self .streaming = True
261267 with self .create_pipeline () as p :
262268 result = (
0 commit comments