o
    QDi                     @  sf   d dl mZ d dlmZ d dlZddlmZ ddlmZ ddlm	Z	 ej
dd	d
G dd deZdS )    )annotations)UnionN   )Step)platformResourceTF)kw_onlyreprc                   @  sd   e Zd ZU dZdZded< 	 dZded< 	 dd	d
ZdgdddgiddiddZe	dddZ
dS )table_intersectzqIntersect tables.

    This step can be added using the `steps` parameter
    for the `transform` function.

    ztable-intersectzUnion[Resource, str]resourceFbooluse_hashr   c                 C  sh   |}| j }t|tr|jsJ |j|}|  | }| }| jr(tj	j
ntj	j}||||_d S )N)r   
isinstancestrpackageget_resourceinferto_petlr   r   petlhashintersectionintersectiondata)selfr   targetsourceview1view2function r   a/var/www/Datamplify/venv/lib/python3.10/site-packages/frictionless/steps/table/table_intersect.pytransform_resource&   s   


z"table_intersect.transform_resourcetypeobjectstringboolean)r   useHash)required
propertiesnamer   c                 C  s   |dkrt S d S )Nr   r   )clsr)   r   r   r    metadata_select_property_class@   s   z.table_intersect.metadata_select_property_classN)r   r   )r)   r   )__name__
__module____qualname____doc__r"   __annotations__r   r!   metadata_profile_patchclassmethodr+   r   r   r   r    r      s   
 
	
r   )
__future__r   typingr   attrspipeliner   r   r   r   definer   r   r   r   r    <module>   s    