o
    QDiy                     @  sj   d dl mZ d dlmZmZmZmZ d dl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AnyDictOptionalN   )Step)ResourceTF)kw_onlyreprc                   @  sp   e Zd ZU dZdZdZded< 	 dZded< 	 dZded< 	 dZ	d	ed
< 	 dddZ
di ddiddidiZdS )cell_convertzConvert cell

    Converts cell values of one or more fields using arbitrary functions, method
    invocations or dictionary translations.

    zcell-convertNzOptional[Any]valuezOptional[Dict[str, Any]]mappingfunctionzOptional[str]
field_nameresourcer	   c                   s   |  } j} js|s fdd}|||_d S  jr'| j||_d S  jr5| j j|_d S | j j|_d S )Nc                   s    j S )N)r   )_self ]/var/www/Datamplify/venv/lib/python3.10/site-packages/frictionless/steps/cell/cell_convert.py<lambda>+   s    z1cell_convert.transform_resource.<locals>.<lambda>)	to_petlr   r   
convertalldataconvertr   updater   )r   r   tabler   r   r   r   transform_resource&   s   zcell_convert.transform_resource
propertiestypeobjectstring)r   r   	fieldName)r   r	   )__name__
__module____qualname____doc__r    r   __annotations__r   r   r   r   metadata_profile_patchr   r   r   r   r      s$   
 
r   )
__future__r   typingr   r   r   r   attrspipeliner   r   r	   definer   r   r   r   r   <module>   s    