Skip to main content

dataset_liveness

Whether a dataset is still live for a trial.

A dataset is live for a trial unless one of two things says otherwise:

  1. The Hub reports it unlinked from that trial (its hub_link state in dataset_states).
  2. The pod no longer has it configured (configured_datasources) — but only once a snapshot of the pod's datasets has been written. A table with no live row means no snapshot yet, not nothing configured, so every dataset then counts as live rather than all of them being treated as removed.

Module​

Functions​

load_dataset_liveness​

def load_dataset_liveness(    cache: CacheProtocol, project_id: str,) ‑> DatasetLiveness:

Read the liveness of every dataset for project_id.

Arguments

  • cache: An open cache instance satisfying CacheProtocol.
  • project_id: The trial (project).

Returns The trial's DatasetLiveness.

Classes​

DatasetLiveness​

class DatasetLiveness(    snapshot_known: bool,    configured: frozenset[str],    names: Mapping[str, str],    unlinked: frozenset[str],):

Which datasets are live for one trial, as read from the cache.

Attributes

  • snapshot_known: Whether any configured-datasources row is live, i.e. whether a snapshot of the pod's datasets has been written.
  • configured: Task hashes of the datasets with no deconfigured_at.
  • names: Datasource name by task hash, tombstoned rows included.
  • unlinked: Names of the datasets the Hub reports unlinked from the trial.

Variables​

  • configured : frozenset[str]
  • names : Mapping[str, str]
  • snapshot_known : bool
  • unlinked : frozenset[str]

Methods​


is_live​

def is_live(self, task_hash: str) ‑> bool:

Return whether the dataset behind task_hash is live for the trial.

Arguments

  • task_hash: The dataset's task hash.