diff --git a/sentry_sdk/integrations/beam.py b/sentry_sdk/integrations/beam.py index c88b15b60f..3098f04929 100644 --- a/sentry_sdk/integrations/beam.py +++ b/sentry_sdk/integrations/beam.py @@ -79,7 +79,15 @@ def _inspect(self): process_func = getattr(self, func_name) setattr(self, func_name, _wrap_task_call(process_func)) setattr(self, wrapped_func, process_func) - return getfullargspec(process_func) + + # getfullargspec is deprecated in more recent beam versions and get_function_args_defaults + # (which uses Signatures internally) should be used instead. + try: + from apache_beam.transforms.core import get_function_args_defaults + + return get_function_args_defaults(process_func) + except ImportError: + return getfullargspec(process_func) setattr(_inspect, USED_FUNC, True) return _inspect diff --git a/tox.ini b/tox.ini index be9ff65d11..c79a92452c 100644 --- a/tox.ini +++ b/tox.ini @@ -32,8 +32,8 @@ envlist = {pypy,py2.7,py3.5,py3.6,py3.7,py3.8}-celery-{4.1,4.2,4.3} {pypy,py2.7}-celery-3 - {py2.7,py3.6}-beam-{12,13} - py3.7-beam-{12,13} + py2.7-beam-{12,13} + py3.7-beam-{12,13, master} # The aws_lambda tests deploy to the real AWS and have their own matrix of Python versions. py3.7-aws_lambda @@ -98,6 +98,7 @@ deps = beam-12: apache-beam>=2.12.0, <2.13.0 beam-13: apache-beam>=2.13.0, <2.14.0 + beam-master: git+https://github.com/apache/beam#egg=apache-beam&subdirectory=sdks/python celery-3: Celery>=3.1,<4.0 celery-4.1: Celery>=4.1,<4.2