o
    QDip                     @  sz   d dl mZ d dlmZmZ d dlZddlmZ ddlm	Z	 ddl
m
Z
 er,ddlmZ ejd	d
dG dd de	ZdS )    )annotations)TYPE_CHECKINGListN   )fields)Step)platform)ResourceTF)kw_onlyreprc                   @  st   e Zd ZU dZdZded< 	 ded< 	 ded< 	 dZd	ed
< 	 dddZg dddiddiddiddiddZdS )field_splitzkSplit field.

    This step can be added using the `steps` parameter
    for the `transform` function.
    zfield-splitstrnamez	List[str]to_namespatternFboolpreserveresourcer	   c                 C  sz   |  }| jD ]}tj|d}|j| q| js |j| j t	j
j}d| jv r-t	j
j}||| j| j| j| jd|_d S )N)r   ()include_original)to_petlr   r   StringFieldschema	add_fieldr   remove_fieldr   r   petlsplitr   capturedata)selfr   tableto_namefield	processor r$   ]/var/www/Datamplify/venv/lib/python3.10/site-packages/frictionless/steps/field/field_split.pytransform_resource0   s    

zfield_split.transform_resource)r   toNamesr   typestringarrayboolean)r   r'   r   r   )required
propertiesN)r   r	   )	__name__
__module____qualname____doc__r(   __annotations__r   r&   metadata_profile_patchr$   r$   r$   r%   r      s&   
 

r   )
__future__r   typingr   r   attrs r   pipeliner   r   r   r	   definer   r$   r$   r$   r%   <module>   s    