o
    +if[                     @   s   d dl mZmZmZmZmZ d dlmZ ddlm	Z	 ddl
mZ ddlmZmZmZ G dd deZG d	d
 d
eZG dd deeZG dd deZG dd deZG dd deZG dd deZG dd deZG dd deZG dd deZdS )    )AnyDictListOptionalUnion)HfFileSystem   )config)	CastError)TrackedIterabletracked_listtracked_strc                   @      e Zd ZdZdS )DatasetsErrorz*Base class for exceptions in this library.N__name__
__module____qualname____doc__ r   r   L/var/www/html/corbot_env/lib/python3.10/site-packages/datasets/exceptions.pyr          r   c                   @   r   )DefunctDatasetErrorzThe dataset has been defunct.Nr   r   r   r   r   r      r   r   c                   @   r   )FileNotFoundDatasetsErrorz)FileNotFoundError raised by this library.Nr   r   r   r   r   r      r   r   c                   @   r   )DataFilesNotFoundErrorz No (supported) data files found.Nr   r   r   r   r   r      r   r   c                   @   r   )DatasetNotFoundErrorzDataset not found.

    Raised when trying to access:
    - a missing dataset, or
    - a private/gated dataset and the user is not authenticated.
    Nr   r   r   r   r   r      r   r   c                   @      e Zd ZdS )DatasetBuildErrorNr   r   r   r   r   r   r   r   %       r   c                   @   r   )ManualDownloadErrorNr   r   r   r   r   r    )   r   r    c                   @   r   )FileFormatErrorNr   r   r   r   r   r!   -   r   r!   c                   @   r   )DatasetGenerationErrorNr   r   r   r   r   r"   1   r   r"   c                   @   sB   e Zd Zedededeeef dee	e
ef  dd f
ddZdS )	DatasetGenerationCastError
cast_errorbuilder_name
gen_kwargstokenreturnc           
      C   s  d|   }g }| D ]h}t|tttfsqt|ttfr3|jd ur3|j}t|ttfr3|jd us$t|tr<| }t|trn|	drnt
tj|d|}d|  }d|j |v rn|d|j ddd|j d }|t| q|r|d	| d
d| 7 }d}	| d| |	 S )NzC

All the data files must have the same columns, but at some point zhf://)endpointr'   @ r   z (at revision )z

This happened while the z, dataset builder was generating data using

z, z

Please either edit the data files to have matching columns, or separate them into different configurations (see docs at https://hf.co/docs/hub/datasets-manual-configuration#multiple-configurations)z.An error occurred while generating the dataset)detailsvalues
isinstancer   r   r   	last_item
get_originstr
startswithr   r	   HF_ENDPOINTresolve_path	unresolverevisionreplaceappendjoin)
clsr$   r%   r&   r'   explanation_messageformatted_tracked_gen_kwargs	gen_kwargresolved_pathhelp_messager   r   r   from_cast_error6   s0   	
z*DatasetGenerationCastError.from_cast_errorN)r   r   r   classmethodr
   r2   r   r   r   r   boolrA   r   r   r   r   r#   5   s    
r#   N)typingr   r   r   r   r   huggingface_hubr   r+   r	   tabler
   utils.trackr   r   r   	Exceptionr   r   FileNotFoundErrorr   r   r   r   r    r!   r"   r#   r   r   r   r   <module>   s   	