0i>(ddlZddlZddlmZddlZddlmZddlmZddl m Z m Z m Z m Z ddlmZer5ddlmZddlmZdd lmZdd lmZdd lmZed Zed edefZdZdZdZGddeZdZdZe edZdZdZ y)N)wraps) Integration) ignore_logger)capture_internal_exceptionsensure_integration_enabledevent_from_exceptionreraise) TYPE_CHECKING)Any)Iterator)TypeVar)Callable)ExcInfoTF.)boundz _wrapped_{}_z _inspect_{} _sentry_used_c eZdZdZedZy)BeamIntegrationbeamc ddlm}m}tdtdgdD],}t |t j |t||.|jfd}||_y)Nr)DoFnParDorootzbundle_processor.create)process start_bundle finish_bundlesetupc~t|ddsD]}t||stj|}t||}t|tj|}t|t drbt|t drtt |||t ||t|d|_ ||g|i|y)N_sentry_is_patchedFT) getattrhasattr WRAPPED_FUNCformat INSPECT_FUNC USED_FUNCsetattr_wrap_task_callr ) selffnargskwargs func_name wrapped_func process_func inspect_funcfunction_patchesold_inits K/opt/hc_python/lib/python3.12/site-packages/sentry_sdk/integrations/beam.pysentry_init_pardoz5BeamIntegration.setup_once..sentry_init_pardo7s4!5u=!1I"2y1 #/#6#6y#AL $+2y#9L#*2|/B/B9/M#NL"<EB7$iL L,?I|/LM"2"+/' T2 / / /) apache_beam.transforms.corerrrr'r%r$_wrap_inspect_call__init__)rrr-r4r1r2s @@r3 setup_oncezBeamIntegration.setup_once%se <f/0P)I ##I."43 *>> 00+r5N)__name__ __module__ __qualname__ identifier staticmethodr9r5r3rr"sJ)+)+r5rcNt|syfd}t|td|S)Nctj}t||r t||}n/t|}t |t |t ||| ddlm}||S#t$rddl m }||cYSwxYw)zG Inspect function overrides the way Beam gets argspec. r)get_function_args_defaults)getfullargspec) r#r$r"r!r'r(r6rB ImportError apache_beam.typehints.decoratorsrC)r)r.r/rBrCr-s r3_inspectz$_wrap_inspect_call.._inspectXs $**95 4 &"46L"43L D)_\%B C D, 5 0 N-l; ; 0 G!,/ / 0s A..BBT)r"r'r&)clsr-rFs ` r3r7r7Rs* 3 "00 Hi& Or5cPtfd}t|td|S)z< Wrap task call with a try catch to get exceptions. c |i|}ttjs|St |S#t$r tY._innerzsP ''C#u223J#C((     s2AAT)rr'r&)rQrRs` r3r(r(ts.  4[ ) ) FIt$ Mr5ctj}t||jddd\}}tj||y)z( Send Beam exception to Sentry. rF)typehandled)client_options mechanism)hintN) sentry_sdk get_clientroptions capture_event)exc_infoclienteventrXs r3_capture_exceptionr`sD  " " $F&~~!e4KE4 U.r5ctj}t5t|dddt |y#1swYxYw)z Raise an exception. N)sysr]rr`r )r]s r3rKrKs3 ||~H $ &8$ ' X ' &s <Ac#pK t|#t$rYyt$r tY wxYww)z4 Wrap the generator to handle any failures. N)next StopIterationrJrK)rPs r3rOrOs?  s)O       s$6 6 363636)!rbrM functoolsrrYsentry_sdk.integrationsrsentry_sdk.integrations.loggingrsentry_sdk.utilsrrrr typingr r r r rsentry_sdk._typesrrrr#r%r&rr7r(r`rKrOr?r5r3rls /9!) A8CH-.A   -+k-+`D,O, /- / r5