o
    QDiG                     @  sz   d dl mZ d dlmZmZmZmZmZ d dlZddl	m
Z
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)AnyClassVarListOptionalTypeN   )helperstypes)Metadata)platformTF)kw_onlyreprc                	      s   e Zd ZU dZdZded< d Zded< d Zded< dZded< g Z	d	ed
< e
jddZded< 	 ded< 	  fddZedddd*ddZdZdg dddiddiddiddiddiddidd Zed+d"d#Zed, fd(d)Z  ZS )-ErrorzzError representation.

    It is a baseclass from which other subclasses of errors are inherited or
    derived from.
    errorzClassVar[str]typetitledescriptionz{note}templatezClassVar[List[str]]tagsF)initstrmessagenotec                   sT   |  d |  d |  d |  d | jdgd}t| j|| _t   d S )Nr   r   r   r   )exclude)add_definedmetadata_exportr	   safe_formatr   r   super__attrs_post_init__)self
descriptor	__class__ Q/var/www/Datamplify/venv/lib/python3.10/site-packages/frictionless/error/error.pyr   *   s   



zError.__attrs_post_init__N)rootr   r&   boolr   Optional[List[Type[Error]]]returnList[Type[Error]]c                C  s\   g }t tj D ]"}t|tr+t|| r+|s|| u rq	|r&t|t|r&q	|| q	|S N)	varsr   frictionless_errorsvalues
isinstancer   
issubclasstupleappend)clsr&   r   childrenitemr$   r$   r%   list_children9   s   
zError.list_childrenobject)r   r   r   r   r   r   stringarray)r   required
propertiesOptional[str]c                 C  s   t jj|S r+   )r   frictionlesssystemselect_error_class)r3   r   r$   r$   r%   metadata_select_classW   s   zError.metadata_select_classr!   types.IDescriptoroptionsr   c                   sD   | dd  | dd  | dd  | dd  t j|fi |S )Nr   r   r   r   )popr   metadata_import)r3   r!   rB   r"   r$   r%   rD   [   s
   zError.metadata_import)r&   r'   r   r(   r)   r*   )r   r<   )r!   rA   rB   r   )__name__
__module____qualname____doc__r   __annotations__r   r   r   r   attrsfieldr   r   classmethodr6   metadata_typemetadata_profiler@   rD   __classcell__r$   r$   r"   r%   r      s<   
 r   )
__future__r   typingr   r   r   r   r   rJ    r	   r
   metadatar   r   definer   r$   r$   r$   r%   <module>   s    