관리-도구
편집 파일: beam.cpython-37.pyc
B T a � @ s0 d dl mZ d dlZd dlZd dlmZ d dlmZ d dlm Z d dl mZmZ d dl mZ d dlmZ d d lmZ er�d d lmZ d dlmZ d dlmZ d d lmZ d dlmZ d dlmZ d dlmZ ed�Zededef d�ZdZdZdZ G dd� de�Z!dd� Z"dd� Z#dd� Z$d d!� Z%d"d#� Z&dS )$� )�absolute_importN)�wraps)�Hub)�reraise)�capture_internal_exceptions�event_from_exception)�Integration)� ignore_logger)�MYPY)�Any)�Iterator)�TypeVar)�Optional)�Callable)�Client)�ExcInfo�T�F.)�boundz_wrapped_{}_z_inspect_{}Z _sentry_used_c @ s e Zd ZdZedd� �ZdS )�BeamIntegration�beamc sp ddl m} m} td� td� ddddg� x$� D ]}t| t�|�t| |�� q2W |j�� �fd d �}||_d S )Nr )�DoFn�ParDo�rootzbundle_processor.create�processZstart_bundleZ finish_bundle�setupc s� t | dd�s�xp� D ]h}t||�s"qt�|�}t ||�}t |t�|��}t |td�st |td�st|||� t||t|�� qW d| _�| |f|�|� d S )N�_sentry_is_patchedFT) �getattr�hasattr�WRAPPED_FUNC�format�INSPECT_FUNC� USED_FUNC�setattr�_wrap_task_callr )�self�fn�args�kwargs� func_name�wrapped_func�process_funcZinspect_func)�function_patches�old_init� �M/opt/alt/python37/lib/python3.7/site-packages/sentry_sdk/integrations/beam.py�sentry_init_pardo6 s z5BeamIntegration.setup_once.<locals>.sentry_init_pardo) �apache_beam.transforms.corer r r r# r! r �_wrap_inspect_call�__init__)r r r) r0 r. )r, r- r/ � setup_once$ s zBeamIntegration.setup_onceN)�__name__� __module__�__qualname__� identifier�staticmethodr4 r. r. r. r/ r ! s r c s8 ddl m� t| � �sd S � �fdd�}t|td� |S )Nr )�getfullargspecc sx t �� �}t| |�r t| |�}n&t| � �}t| � t|�� t| ||� yddlm} ||�S tk rr �|�S X dS )zG Inspect function overrides the way Beam gets argspec. r )�get_function_args_defaultsN) r r r r r# r$ r1 r; �ImportError)r% r* r+ r; )r) r: r. r/ �_inspectX s z$_wrap_inspect_call.<locals>._inspectT)Z apache_beam.typehints.decoratorsr: r r# r"