o
    -wi                     @  sn   d dl mZ d dlZd dlmZ er$d dlmZ d dlmZ ddl	m
Z dZdddZdddZdddZdS )    )annotationsN)TYPE_CHECKING)Table)Artifact   )Runzwandb-run-incremental-tablerunLocalRunkeystrreturnc                 C  s"   ddl m} |d| j d| S )Nr   )sanitize_artifact_namezrun-z-incr-)&wandb.sdk.artifacts._internal_artifactr   id)r   r
   r    r   f/home/ubuntu/sommelier/.venv/lib/python3.10/site-packages/wandb/sdk/internal/incremental_table_util.py_get_artifact_name   s   r   sanitized_keyr   c                 C  s$   ddl m} |t| |tdd}|S )a  Initialize a new artifact for an incremental table.

    Args:
        run: The wandb run associated with this artifact
        sanitized_key: Sanitized string key to identify the table

    Returns:
        A wandb Artifact configured for incremental table storage
    r   )InternalArtifactT)incremental)r   r   r   ART_TYPE)r   r   r   artifactr   r   r   init_artifact   s   
r   
incr_tabler   c                 C  s"   t  d }| j d| d| S )a  Generate a unique entry name for a table increment.

    Args:
        run: The wandb run associated with this table
        incr_table: The incremental table being updated
        key: String key for the table entry

    Returns:
        A unique string name for the table entry
    i@B -.)timetime_ns_increment_num)r   r
   epochr   r   r   get_entry_name)   s   r    )r   r	   r
   r   r   r   )r   r	   r   r   r   r   )r   r   r
   r   r   r   )
__future__r   r   typingr   wandbr   wandb.sdk.artifacts.artifactr   	wandb_runr   r	   r   r   r   r    r   r   r   r   <module>   s    

