o
    -wi	                     @  s   d Z ddlmZ ddlmZmZ ddlmZ er$ddlm	Z	 ede	dZ
G dd	 d	eZG d
d deZG dd deZG dd dejZG dd deZG dd deZdS )zArtifact exceptions.    )annotations)TYPE_CHECKINGTypeVar)errors)Artifact	ArtifactT)boundc                      s*   e Zd ZdZ			dd fd
dZ  ZS )ArtifactStatusErrorzKRaised when an artifact is in an invalid state for the requested operation.<Artifact is in an invalid state for the requested operation.Nmsgstrname
str | NoneobjArtifactT | Nonec                   sJ   zt  j|||d W d S  ty$   t  | |pd| _|| _Y d S w )N)r   r    )super__init__	TypeErrorr   r   )selfr   r   r   	__class__ [/home/ubuntu/sommelier/.venv/lib/python3.10/site-packages/wandb/sdk/artifacts/exceptions.pyr      s   
zArtifactStatusError.__init__)r
   NN)r   r   r   r   r   r   __name__
__module____qualname____doc__r   __classcell__r   r   r   r   r	      s    r	   c                      "   e Zd ZdZd fddZ  ZS )	ArtifactNotLoggedErrorzGRaised for Artifact methods or attributes only available after logging.fullnamer   r   r   c                   s>   | d^ }}|dt|jj d}t j|||d d S )N.z? used prior to logging artifact or while in offline mode. Call z/() before accessing logged artifact properties.r   r   r   )splittypewaitr   r   r   r   r"   r   _r   r   r   r   r   r   &   s   
zArtifactNotLoggedError.__init__r"   r   r   r   r   r   r   r   r   r!   #       r!   c                      r    )	ArtifactFinalizedErrorzNRaised for Artifact methods or attributes that can't be changed after logging.r"   r   r   r   c                   s0   | d^ }}|d}t j|||d d S )Nr#   z: used on logged artifact. Can't modify finalized artifact.r$   )r%   r   r   r(   r   r   r   r   2   s   
zArtifactFinalizedError.__init__r*   r   r   r   r   r   r,   /   r+   r,   c                   @     e Zd ZdZdS )WaitTimeoutErrorz=Raised when wait() timeout occurs before process is finished.Nr   r   r   r   r   r   r   r   r.   8       r.   c                   @  r-   )TooFewItemsErrorzjRaised when there are fewer items than expected in a collection.

    Intended for internal use only.
    Nr/   r   r   r   r   r1   <   r0   r1   c                   @  r-   )TooManyItemsErrorziRaised when there are more items than expected in a collection.

    Intended for internal use only.
    Nr/   r   r   r   r   r2   C   r0   r2   N)r   
__future__r   typingr   r   wandbr   wandb.sdk.artifacts.artifactr   r   AttributeErrorr	   r!   r,   Errorr.   
ValueErrorr1   r2   r   r   r   r   <module>   s    	