Skip to content

tdfs4ds.migration.sanity

tdfs4ds.migration.sanity

Sanity check of the processes a migration promotes (0.3.6.13).

plan_migration runs the workflow assessment on the SOURCE store, scoped to the closure, before it inventories anything, and keeps the result in plan['sanity']: the report opens with it. A process used from outside the package (a loop around run, values closed by hand) does not reproduce its data from its registered form, and promoting it carries that to production.

The assessment reads the store named by tdfs4ds.SCHEMA / view_schema() (catalogs, follow-up, lineage, SQL versions, storage layout), so it runs inside :func:source_store, which points those names, and the read-only set, at the source and puts them back in a finally. No LLM, nothing is written; a finding never blocks migrate_objects (approvals stay about conflicts).

MODES module-attribute

MODES = ('cheap', 'full')

logger_safe

logger_safe(level, message, *args, **kwargs)

Wrapper around the global logger that only emits logs when tdfs4ds.DISPLAY_LOGS is True. level is a string like "info", "error", etc.

source_store

source_store(desc: Dict[str, Any])

Point SCHEMA / SCHEMA_VIEW at the source store and empty the read-only set (a union with the target would give the closure's processes to both), restored in a finally. Everything the assessment reads goes through these names; the per-store caches of optional tables (available() of the process options, the manager registry...) are keyed by what they read, not by the store, so a store without an optional table reads as it would on its own.

check_names

check_names(mode: str) -> tuple

The assessment checks mode stands for, read when called so a check added to workflow_assessment later is picked up by itself. cheap keeps closed_entities: its reads are EXPLAIN-gated, and without it a custom step closing periods around roll_out shows nothing (its runs look like a roll_out).

skipped

skipped(note: str, mode=False) -> Dict[str, Any]

run_sanity

run_sanity(closure: List[str], desc: Dict[str, Any], mode='cheap', assess=None) -> Dict[str, Any]

The plan['sanity'] block. Never raises: a failed run is stated in error.

assess is the assessment function (default tdfs4ds.assess_workflow).

finding_acceptances

finding_acceptances(plan: Dict[str, Any], desc: Dict[str, Any], sanity_result: Optional[dict] = None, objects=None) -> List[Dict[str, Any]]

The acceptances of the SOURCE store that concern the plan: those that left a finding out of its sanity check, plus the ones naming an object of the plan (an expired one, or one whose finding no longer shows). Listed in plan['finding_acceptances'] and the report, never copied by migrate_objects: production confirms each with its own justification. Fail-open: [].