|
83 | 83 | from apache_beam.utils.windowed_value import PaneInfoTiming |
84 | 84 | from apache_beam.utils.windowed_value import WindowedValue |
85 | 85 |
|
| 86 | +try: |
| 87 | + import dill |
| 88 | +except ImportError: |
| 89 | + dill = None |
| 90 | + |
86 | 91 | warnings.filterwarnings( |
87 | 92 | 'ignore', category=FutureWarning, module='apache_beam.transform.util_test') |
88 | 93 |
|
@@ -112,6 +117,13 @@ def is_deterministic(self): |
112 | 117 | return True |
113 | 118 |
|
114 | 119 |
|
| 120 | +def maybe_skip(compat_version): |
| 121 | + if compat_version and not dill: |
| 122 | + raise unittest.SkipTest( |
| 123 | + 'Dill dependency not installed which is required for compat_version' |
| 124 | + ' <= 2.67.0') |
| 125 | + |
| 126 | + |
115 | 127 | class CoGroupByKeyTest(unittest.TestCase): |
116 | 128 | def test_co_group_by_key_on_tuple(self): |
117 | 129 | with TestPipeline() as pipeline: |
@@ -997,8 +1009,10 @@ def test_reshuffle_streaming_global_window_with_buckets(self): |
997 | 1009 | param(compat_version=None), |
998 | 1010 | param(compat_version="2.64.0"), |
999 | 1011 | ]) |
| 1012 | + @pytest.mark.uses_dill |
1000 | 1013 | def test_reshuffle_custom_window_preserves_metadata(self, compat_version): |
1001 | 1014 | """Tests that Reshuffle preserves pane info.""" |
| 1015 | + maybe_skip(compat_version) |
1002 | 1016 | element_count = 12 |
1003 | 1017 | timestamp_value = timestamp.Timestamp(0) |
1004 | 1018 | l = [ |
@@ -1098,10 +1112,11 @@ def test_reshuffle_custom_window_preserves_metadata(self, compat_version): |
1098 | 1112 | param(compat_version=None), |
1099 | 1113 | param(compat_version="2.64.0"), |
1100 | 1114 | ]) |
| 1115 | + @pytest.mark.uses_dill |
1101 | 1116 | def test_reshuffle_default_window_preserves_metadata(self, compat_version): |
1102 | 1117 | """Tests that Reshuffle preserves timestamp, window, and pane info |
1103 | 1118 | metadata.""" |
1104 | | - |
| 1119 | + maybe_skip(compat_version) |
1105 | 1120 | no_firing = PaneInfo( |
1106 | 1121 | is_first=True, |
1107 | 1122 | is_last=True, |
|
0 commit comments