8000 fix: integration with Apache Beam 2.32, 2.33 reported in #1231 (#1233) · anilktechie/sentry-python@81b2c70 · GitHub
[go: up one dir, main page]

Skip to content

Commit 81b2c70

Browse files
galuszkakKamil Gałuszka
andauthored
fix: integration with Apache Beam 2.32, 2.33 reported in getsentry#1231 (getsentry#1233)
Co-authored-by: Kamil Gałuszka <galuszkak@FVFGC0XHQ05P.local>
1 parent 49cae60 commit 81b2c70

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

sentry_sdk/integrations/beam.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ def sentry_init_pardo(self, fn, *args, **kwargs):
8080

8181
def _wrap_inspect_call(cls, func_name):
8282
# type: (Any, Any) -> Any
83-
from apache_beam.typehints.decorators import getfullargspec # type: ignore
8483

8584
if not hasattr(cls, func_name):
8685
return None
@@ -105,6 +104,8 @@ def _inspect(self):
105104

106105
return get_function_args_defaults(process_func)
107106
except ImportError:
107+
from apache_beam.typehints.decorators import getfullargspec # type: ignore
108+
108109
return getfullargspec(process_func)
109110

110111
setattr(_inspect, USED_FUNC, True)

tests/integrations/beam/test_beam.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,9 @@ def test_monkey_patch_signature(f, args, kwargs):
152152

153153

154154
class _OutputProcessor(OutputProcessor):
155-
def process_outputs(self, windowed_input_element, results):
155+
def process_outputs(
156+
self, windowed_input_element, results, watermark_estimator=None
157+
):
156158
print(windowed_input_element)
157159
try:
158160
for result in results:

tox.ini

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ envlist =
4646
{pypy,py2.7,py3.5,py3.6,py3.7,py3.8}-celery-{4.3,4.4}
4747
{py3.6,py3.7,py3.8}-celery-5.0
4848

49-
py3.7-beam-{2.12,2.13}
49+
py3.7-beam-{2.12,2.13,2.32,2.33}
5050

5151
# The aws_lambda tests deploy to the real AWS and have their own matrix of Python versions.
5252
py3.7-aws_lambda
@@ -140,6 +140,8 @@ deps =
140140

141141
beam-2.12: apache-beam>=2.12.0, <2.13.0
142142
beam-2.13: apache-beam>=2.13.0, <2.14.0
143+
beam-2.32: apache-beam>=2.32.0, <2.33.0
144+
beam-2.33: apache-beam>=2.33.0, <2.34.0
143145
beam-master: git+https://github.com/apache/beam#egg=apache-beam&subdirectory=sdks/python
144146

145147
celery: redis

0 commit comments

Comments
 (0)
0