Skip to content

Commit cce401d

Browse files
AbhiPrasaduntitaker
authored andcommitted
fix: Beam Integration Tests (getsentry#500)
* Revert "fix: Remove beam-master build" This reverts commit 2dbcbbb. * Fix beam tests Add conditional check to use get_function_args_defaults instead of getfullargspec if available * Add python 2.7
1 parent 555bb32 commit cce401d

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

sentry_sdk/integrations/beam.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,15 @@ def _inspect(self):
7979
process_func = getattr(self, func_name)
8080
setattr(self, func_name, _wrap_task_call(process_func))
8181
setattr(self, wrapped_func, process_func)
82-
return getfullargspec(process_func)
82+
83+
# getfullargspec is deprecated in more recent beam versions and get_function_args_defaults
84+
# (which uses Signatures internally) should be used instead.
85+
try:
86+
from apache_beam.transforms.core import get_function_args_defaults
87+
88+
return get_function_args_defaults(process_func)
89+
except ImportError:
90+
return getfullargspec(process_func)
8391

8492
setattr(_inspect, USED_FUNC, True)
8593
return _inspect

tox.ini

+3-2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ envlist =
3232
{pypy,py2.7,py3.5,py3.6,py3.7,py3.8}-celery-{4.1,4.2,4.3}
3333
{pypy,py2.7}-celery-3
3434

35-
{py2.7,py3.6}-beam-{12,13}
36-
py3.7-beam-{12,13}
35+
py2.7-beam-{12,13}
36+
py3.7-beam-{12,13, master}
3737

3838
# The aws_lambda tests deploy to the real AWS and have their own matrix of Python versions.
3939
py3.7-aws_lambda
@@ -98,6 +98,7 @@ deps =
9898

9999
beam-12: apache-beam>=2.12.0, <2.13.0
100100
beam-13: apache-beam>=2.13.0, <2.14.0
101+
beam-master: git+https://github.com/apache/beam#egg=apache-beam&subdirectory=sdks/python
101102

102103
celery-3: Celery>=3.1,<4.0
103104
celery-4.1: Celery>=4.1,<4.2

0 commit comments

Comments
 (0)