Skip to main content

v1

dataset_states record, v1 — canonical aliases.

Consumers and the record registry import from here and never touch the inner module names, mirroring flow_specs/v1/__init__.py.

Module​

Submodules​

Classes​

Record​

class Record(**data: Any):

The current state of one kind for one dataset in one trial.

kind and state are plain strings rather than the enums above, so a row written by a newer version with a kind this one does not know still reads.

Attributes

  • project_id: The trial (project) the state applies to. Empty for a state of the dataset itself rather than of its place in one trial.
  • datasource_name: The dataset's name.
  • kind: Which kind of state this is (a DatasetStateKind value).
  • state: The current state of that kind (e.g. a HubLinkState value).
  • state_since: When the dataset was first seen in state, ISO 8601; reset each time the state changes.
  • last_checked_at: When state was last reported or confirmed, ISO 8601.
  • tags: Arbitrary flat metadata.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Variables​

  • static datasource_name : str
  • static kind : str
  • static last_checked_at : str
  • static model_config
  • static project_id : str
  • static state : str
  • static state_since : str

ORM​

class ORM(**kwargs):

SQLAlchemy model for the dataset_states cache table.

One row per (project_id, datasource_name, kind): the dataset's current state of that kind in that trial, and since when. A new kind of state needs no schema change, only new kind and state values (model.py). No row means nothing has been recorded for that kind yet.

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance's class are allowed. These could be, for example, any mapped columns or relationships.

Variables​

  • datasource_name : sqlalchemy.orm.base.Mapped[str]
  • kind : sqlalchemy.orm.base.Mapped[str]
  • last_checked_at : sqlalchemy.orm.base.Mapped[str]
  • project_id : sqlalchemy.orm.base.Mapped[str]
  • state : sqlalchemy.orm.base.Mapped[str]
  • state_since : sqlalchemy.orm.base.Mapped[str]
  • tags : sqlalchemy.orm.base.Mapped[dict[str, typing.Any] | None]