v2
configured_datasources record, v2 — canonical aliases.
v2 adds the nullable indexing-order columns config_last_updated,
archived_only and health_status — see schema.py.
Module
Submodules
- bitfount.cache.types.configured_datasources.v2.migrations - Autogenerated migration for
configured_datasourcesv1 -> v2. - bitfount.cache.types.configured_datasources.v2.model - Pydantic records for the
configured_datasourcescache table (v2). - bitfount.cache.types.configured_datasources.v2.schema - SQLAlchemy ORM for the
configured_datasourcescache table (v2). - bitfount.cache.types.configured_datasources.v2.store - CRUD for the
configured_datasourcesrecord (v2).
Functions
downgrade
def downgrade(op: Operations) ‑> None:Migrate configured_datasources v2 -> v1 (see the module docstring).
upgrade
def upgrade(op: Operations) ‑> None:Migrate configured_datasources v1 -> v2 (see the module docstring).
Classes
Record
class Record(**data: Any):One datasource the pod has configured, or used to.
Attributes
task_hash: The datasource leaf hash, asfile_metadataandrunscarry it.pod_name: Pod the datasource belongs to.datasource_name: Name of the datasource within that pod.deconfigured_at: When the datasource stopped being in the pod config.Nonewhile it still is.last_seen_at: When the pod last took a snapshot covering this row.config_last_updated: SeeDatasourceMetadata.archived_only: SeeDatasourceMetadata.health_status: SeeDatasourceMetadata.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
archived_only : bool | None
- static
config_last_updated : datetime.datetime | None
- static
datasource_name : str
- static
deconfigured_at : datetime.datetime | None
- static
health_status : str | None
- static
last_seen_at : datetime.datetime
- static
model_config
- static
pod_name : str
- static
tags : dict[str, typing.Any] | None
- static
task_hash : str
metadata : DatasourceMetadata- The indexing-order columns of this row.
ORM
class ORM(**kwargs):SQLAlchemy model for the configured_datasources cache table.
One row per datasource the pod has ever had configured, recording whether
it is configured now. Written as a whole-set snapshot by the pod, which is
the only process that knows the pod config; read by processes that hold the
cache but not the config — chiefly file_metadata_refresh, which runs in
the orchestrator and would otherwise re-index a datasource that was removed
from the pod weeks ago.
A removed datasource is tombstoned rather than deleted, and its
file_metadata rows are left alone: those rows are keyed by file_path
alone and are shared inventory (see file_metadata/v1/store.py's
prune_missing_under_root), so a delete scoped by task_hash would blind a
surviving datasource whose root overlaps.
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.
Ancestors
Variables
-
archived_only : Union[sqlalchemy.orm.attributes.InstrumentedAttribute[+_T_co], +_T_co]
-
config_last_updated : Union[sqlalchemy.orm.attributes.InstrumentedAttribute[+_T_co], +_T_co]
-
datasource_name : Union[sqlalchemy.orm.attributes.InstrumentedAttribute[+_T_co], +_T_co]
-
deconfigured_at : Union[sqlalchemy.orm.attributes.InstrumentedAttribute[+_T_co], +_T_co]
-
health_status : Union[sqlalchemy.orm.attributes.InstrumentedAttribute[+_T_co], +_T_co]
-
last_seen_at : Union[sqlalchemy.orm.attributes.InstrumentedAttribute[+_T_co], +_T_co]
-
pod_name : Union[sqlalchemy.orm.attributes.InstrumentedAttribute[+_T_co], +_T_co]
-
tags : Union[sqlalchemy.orm.attributes.InstrumentedAttribute[+_T_co], +_T_co]
-
task_hash : Union[sqlalchemy.orm.attributes.InstrumentedAttribute[+_T_co], +_T_co]