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:
- The Hub reports it unlinked from that trial (its
hub_linkstate indataset_states). - 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 satisfyingCacheProtocol.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 nodeconfigured_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.