1111from sentry_sdk .integrations .logging import ignore_logger
1212
1313WRAPPED_FUNC = "_wrapped_{}_"
14- INSPECT_FUNC = "_inspect_{}"
14+ INSPECT_FUNC = "_inspect_{}" # Required format per apache_beam/transforms/core.py
15+ USED_FUNC = "_sentry_used_"
1516
1617
1718class BeamIntegration (Integration ):
@@ -49,8 +50,8 @@ def sentry_init_pardo(self, fn, *args, **kwargs):
4950 # backwards compatibility.
5051 process_func = getattr (fn , func_name )
5152 inspect_func = getattr (fn , INSPECT_FUNC .format (func_name ))
52- if not getattr (inspect_func , "__used__" , False ) and not getattr (
53- process_func , "__used__" , False
53+ if not getattr (inspect_func , USED_FUNC , False ) and not getattr (
54+ process_func , USED_FUNC , False
5455 ):
5556 setattr (fn , wrapped_func , process_func )
5657 setattr (fn , func_name , _wrap_task_call (process_func ))
@@ -80,7 +81,7 @@ def _inspect(self):
8081 setattr (self , wrapped_func , process_func )
8182 return getfullargspec (process_func )
8283
83- setattr (_inspect , "__used__" , True )
84+ setattr (_inspect , USED_FUNC , True )
8485 return _inspect
8586
8687
@@ -102,7 +103,7 @@ def _inner(*args, **kwargs):
102103 return gen
103104 return _wrap_generator_call (gen , client )
104105
105- setattr (_inner , "__used__" , True )
106+ setattr (_inner , USED_FUNC , True )
106107 return _inner
107108
108109
0 commit comments