o
    QDim                     @   s   d dl mZmZmZmZ ddlmZ ddlmZm	Z	 ddl
mZ ddlmZ ddlmZ 	ddddg g g ejdd	dd

dee dee dee deee	ef  dee dee dee dedee dedee defddZdS )    )AnyListOptionalUnion   )settings)Check	Checklist)FrictionlessException)Report)ResourceNF)
nametype	checklistcheckspick_errorsskip_errorslimit_errors
limit_rowsparallelresource_namesourcer   r   r   r   r   r   r   r   r   r   optionsc       
      
   K   s   |p|
}t |trt|}n	|st|||d}zt | tr | n	t| fd|i|}W n" tyM } z|jr9|jn|jg}tj	|dW  Y d}~S d}~ww |j
|||	||dS )a  Validate resource

    Parameters:
        source (dict|str): a data source
        type (str): source type - inquiry, package, resource, schema or table
        **options (dict): options for the underlaying function

    Returns:
        Report: validation report
    )r   r   r   datatype)errorsN)r   r   r   r   )
isinstancestrr	   from_descriptorr   r
   reasonserrorr   from_validationvalidate)r   r   r   r   r   r   r   r   r   r   r   r   resource	exceptionr    r$   V/var/www/Datamplify/venv/lib/python3.10/site-packages/frictionless/actions/validate.pyr!   
   s4   
r!   )N)typingr   r   r   r    r   r   r   r	   r#   r
   reportr   r"   r   DEFAULT_LIMIT_ERRORSr   intboolr!   r$   r$   r$   r%   <module>   sV    	