tdfs4ds.migration.report¶
tdfs4ds.migration.report
¶
Human-readable approval report for a cross-store migration manifest (v0.3.1.150). Cheap, no LLM — pure rendering of the plan dict.
KIND_LABELS
module-attribute
¶
KIND_LABELS = {'source_table': 'table', 'intermediate_view': 'view read by the processes', 'process_view': 'process view', 'dataset': 'dataset', 'downstream_view': 'view reading the datasets', 'unverified': 'not verified'}
LANES
module-attribute
¶
LANES = (('tables', 'Tables'), ('views', 'Views'), ('managers', 'Managers'), ('processes', 'Processes'), ('datasets', 'Datasets'), ('downstream', 'Downstream views'))
ACTIONS
module-attribute
¶
ACTIONS = (('create', 'created in the target', '#00233C'), ('identical', 'identical (kept)', '#1e8449'), ('exists', 'already there (reused / unified)', '#27ae60'), ('conflict', 'conflict: exists, different', '#FF5F00'), ('stays', 'stays where it is', '#95a5a6'), ('blocked', 'blocked (reads what is not migrated)', '#c0392b'), ('unverified', 'not verified', '#e2b007'))
_LANE_OF
module-attribute
¶
_LANE_OF = {'source_table': 'tables', 'intermediate_view': 'views', 'unverified': 'views', 'process_view': 'processes', 'dataset': 'datasets', 'downstream_view': 'downstream'}
_DIAGRAM_CSS
module-attribute
¶
_DIAGRAM_CSS = '<style>.td-migdiag{font-family:system-ui,-apple-system,Segoe UI,Roboto,sans-serif;color:#00233C;max-width:100%;margin:8px 0}.td-migdiag svg{width:100%;height:auto;display:block}.td-migdiag .lg{display:flex;flex-wrap:wrap;gap:10px;font-size:12px;margin:6px 0}.td-migdiag .sw{display:inline-block;width:11px;height:11px;border-radius:2px;margin-right:4px;vertical-align:-1px}.td-migdiag details{border:1px solid #E3E8EE;border-radius:6px;margin:4px 0;padding:4px 10px;background:#fff}.td-migdiag summary{cursor:pointer;font-weight:600;font-size:13px}.td-migdiag ul{margin:4px 0 6px;padding-left:18px;font-size:12px;max-height:320px;overflow:auto}.td-migdiag code{font-family:ui-monospace,Menlo,Consolas,monospace;font-size:12px;overflow-wrap:anywhere}.td-migdiag .ac{font-size:11px;padding:0 6px;border-radius:8px;color:#fff;margin-left:4px}</style>'
norm_name
¶
Uppercase, de-quoted, stripped — the canonical comparison form.
render_migration_report
¶
Render the migration manifest as an approval-ready report.
Parameters¶
plan : dict
A manifest from :func:tdfs4ds.plan_migration.
fmt : 'markdown' | 'html'
Output format (default markdown).
_flagged
¶
Names of the processes with an error or warning finding: promoting one carries the problem to production.
_render_html
¶
Compact self-contained HTML summary (for the admin panel).
kind_label
¶
The people's name of an object kind of the plan (the raw kind when unknown).
_identical_lines
¶
The objects kept because the target has them with the same definition (0.3.8.15), the
processes kept as they are, and what refreshes the branch of a replaced object. [] when
nothing is identical (a plan with nothing in the target renders as before).
diagram_items
¶
{lane: [{source, target, action}]} of the plan, one item per object / manager / clock. Pure.
render_migration_diagram
¶
An inline SVG + scoped CSS fragment (no script) of the plan: the source store on the
left, the target on the right, one lane per kind (tables, views, managers, processes,
datasets, downstream views) with its count, the target box split by action, and under it
one <details> panel per lane listing every object source -> target with its action.
write_migration_report
¶
write_migration_report(plan: Dict[str, Any], out_path: Optional[str] = None, fmt: str = 'html') -> str
Write the approval report as a standalone page (fmt='html': doctype, charset, title
"Migration plan", light theme, the diagram first) or Markdown (fmt='markdown') and
return its path (default: tdfs4ds.SCHEDULING_SCRIPT_DIR or the working directory).