11
11
from sentry_sdk .integrations .logging import ignore_logger
12
12
13
13
WRAPPED_FUNC = "_wrapped_{}_"
14
- INSPECT_FUNC = "_inspect_{}"
14
+ INSPECT_FUNC = "_inspect_{}" # Required format per apache_beam/transforms/core.py
15
+ USED_FUNC = "_sentry_used_"
15
16
16
17
17
18
class BeamIntegration (Integration ):
@@ -49,8 +50,8 @@ def sentry_init_pardo(self, fn, *args, **kwargs):
49
50
# backwards compatibility.
50
51
process_func = getattr (fn , func_name )
51
52
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
54
55
):
55
56
setattr (fn , wrapped_func , process_func )
56
57
setattr (fn , func_name , _wrap_task_call (process_func ))
@@ -80,7 +81,7 @@ def _inspect(self):
80
81
setattr (self , wrapped_func , process_func )
81
82
return getfullargspec (process_func )
82
83
83
- setattr (_inspect , "__used__" , True )
84
+ setattr (_inspect , USED_FUNC , True )
84
85
return _inspect
85
86
86
87
@@ -102,7 +103,7 @@ def _inner(*args, **kwargs):
102
103
return gen
103
104
return _wrap_generator_call (gen , client )
104
105
105
- setattr (_inner , "__used__" , True )
106
+ setattr (_inner , USED_FUNC , True )
106
107
return _inner
107
108
108
109
0 commit comments