˺hXddlmZddlZddlZddlmZddlmZddlm Z ddl m Z m Z ddl mZddlmZdd lmZerJdd lmZdd lmZdd lmZdd lmZddlmZddlmZddlmZedZededefZdZdZdZ GddeZ!dZ"dZ#dZ$dZ%dZ&dS))absolute_importN)wraps)Hub)reraise)capture_internal_exceptionsevent_from_exception) Integration) ignore_logger)MYPY)Any)Iterator)TypeVar)Optional)Callable)Client)ExcInfoTF.)boundz _wrapped_{}_z _inspect_{} _sentry_used_c(eZdZdZedZdS)BeamIntegrationbeamc ddlm}m}tdtdgdD]9}t |t |t||:|jfd}||_dS)Nr)DoFnParDorootzbundle_processor.create)process start_bundle finish_bundlesetupct|ddsʉD]}t||st|}t||}t|t|}t|t dsEt|t ds/t |||t ||t|d|_ ||g|Ri|dS)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 |/builddir/build/BUILD/imunify360-venv-2.5.2/opt/imunify360/venv/lib/python3.11/site-packages/sentry_sdk/integrations/beam.pysentry_init_pardoz5BeamIntegration.setup_once..sentry_init_pardo6s4!5u== /!1NNI"2y11! #/#6#6y#A#AL $+2y#9#9L#*2|/B/B9/M/M#N#NL"<EBBN7$iLLN L,???I|/L/LMMM*.' HT2 / / / / / / / / /) apache_beam.transforms.corerrr r*r(r'_wrap_inspect_call__init__)rrr0r7r4r5s @@r6 setup_oncezBeamIntegration.setup_once$s <;;;;;;;f/000PPP)  I ##I.."433     > 0 0 0 0 0 00+r8N)__name__ __module__ __qualname__ identifier staticmethodr<r8r6rr!s2J)+)+\)+)+)+r8rcrddlmt|sdSfd}t|td|S)Nr)getfullargspeccRt}t||rt||}n?t|}t |t |t ||| ddlm}||S#t$r|cYSwxYw)zG Inspect function overrides the way Beam gets argspec. r)get_function_args_defaults) r&r'r%r$r*r+r9rF ImportError)r,r1r2rFr0rDs r6_inspectz$_wrap_inspect_call.._inspectXs $**955 4 & & 6"466LL"433L D)_\%B%B C C C D, 5 5 5 0 N N N N N N--l;; ; 0 0 0!>,// / / / 0s=BB&%B&T) apache_beam.typehints.decoratorsrDr%r*r))clsr0rHrDs ` @r6r:r:Qsd?????? 3 " "t000000, Hi&&& Or8ctjjtfd}t |t d|S)z~ Wrap task call with a try catch to get exceptions. Pass the client on to raise_exception so it can get rebinded. c |i|}n#t$rtYnwxYwt|tjs|St |S)N) Exceptionraise_exception isinstancetypes GeneratorType_wrap_generator_call)r.r/genclientfuncs r6_innerz_wrap_task_call.._innerzsy $$'''CC $ $ $ F # # # # # $#u233 J#C000s  ((T)rcurrentrTrr*r))rUrVrTs` @r6r+r+rsW [ F 4[[ 1 1 1 1 1[ 1 FIt$$$ Mr8c|t}|dS|j}|dSt||jddd\}}|||dS)z( Send Beam exception to Sentry. NrF)typehandled)client_options mechanism)hint)get_integrationrrTroptions capture_event)exc_infohub integrationrTeventr]s r6_capture_exceptionres %%o66K ZF ~&~!e44KE4 e$'''''r8ctj}|j||t j}t 5t||dddn #1swxYwYt|dS)zI Raise an exception. If the client is not in the hub, rebind it. N) rrWrT bind_clientsysrarrer)rTrbras r6rNrNs +C z |~~H $ & &**8S)))*************** Xs A''A+.A+c#K t|Vn+#t$rYdSt$rt|YnwxYw?)z4 Wrap the generator to handle any failures. TN)next StopIterationrMrN)rSrTs r6rRrRsn $ $s))OOOO    EE $ $ $ F # # # # # $ $s ???)' __future__rrhrPsentry_sdk._functoolsrsentry_sdk.hubrsentry_sdk._compatrsentry_sdk.utilsrrsentry_sdk.integrationsr sentry_sdk.integrations.loggingr sentry_sdk._typesr typingr r rrrsentry_sdk.clientrrrrr&r(r)rr:r+rerNrRrBr8r6rvs&&&&&& ''''''&&&&&&NNNNNNNN//////999999"""""" /(((((()))))) A8CH-...A   -+-+-+-+-+k-+-+-+`B0(((*    $ $ $ $ $r8