Skip to content

DatasetUIDCacheManager

Manages a cache of the last 50 uploaded datasets, tracking dataset hashes and their UIDs.

__init__

__init__()

load_cache

load_cache()

Loads the cache from disk if it exists, otherwise initializes an empty cache.

get_dataset_uid

get_dataset_uid(*args)

Generates hash by all received arguments and returns cached dataset uid if in cache, otherwise None.

add_dataset_uid

add_dataset_uid(hash: str, dataset_uid: str)

Adds a new dataset to the cache, removing the oldest item if the cache exceeds 50 entries. Assumes the dataset is not already in the cache.

save_cache

save_cache()

Saves the current cache to disk.

delete_uid

delete_uid(dataset_uid: str) -> Optional[str]

Deletes an entry from the cache based on the dataset UID.