Skip to content

Commit 1453674

Browse files
author
Osmar Coronel
committed
Created string variable for used functions
1 parent 80260b4 commit 1453674

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

sentry_sdk/integrations/beam.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
from sentry_sdk.integrations.logging import ignore_logger
1212

1313
WRAPPED_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

1718
class 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

Comments
 (0)