Skip to content

fs-sanity-check

Run the sanity checks in one call (tdfs4ds.sanity_check), write the HTML or Markdown report, read the verdict and decide what to fix first. No language model; nothing is changed.


name: "Feature Store: Sanity check" description: "Generate code to run the tdfs4ds sanity checks in one call and write the HTML or Markdown report (tdfs4ds.sanity_check), read the verdict, say whether run() and roll_out() can still refresh each process, and decide what to fix first. Code only, no language model, changes nothing. Invoke when the user asks for a sanity check or health check, whether a pipeline or store is healthy, whether a process can still be refreshed, or what to check before a migration. SKIP for what one finding means in detail or for the thresholds of the checks (use fs-workflow-assessment), for catalog/storage consistency and orphans (use fs-inspect) and for the performance of one process (use fs-analyze)." argument-hint: "[report path][data-domain] [processes]" allowed-tools: "Read, Edit, Write, Bash, Glob, Grep"


Generate Python code that runs the tdfs4ds sanity checks and writes the report, then help the user read it.

User context: $ARGUMENTS

Step Skill Why
Before fs-setup Connect first if no Teradata context is open.
Before fs-lineage-graph The order and input checks read the persisted lineage graph.
Details fs-workflow-assessment Every finding with its meaning and fix; findings as data; thresholds.
Fix fs-upload Stay inside the framework: what replaces a loop or a custom step around a process.
Fix fs-rollout Re-run in the right order, rebuild a history.
After fs-migrate A migration report opens with these checks on the source store.

Ask for any missing values before generating code: - Report format: HTML to read or share, Markdown for a wiki. - Scope: cheap unless the user asks about entity keys or empty dataset columns. - Data domains or processes, or the whole store.

Run

import tdfs4ds
tdfs4ds.connect(database='<DATABASE>')

path = tdfs4ds.sanity_check('<REPORT>.html')        # a .md path writes Markdown; returns the path
Argument Meaning
out_path The report file. Default: tdfs4ds.DASHBOARD_REPORT_DIR.
fmt 'html' or 'md', overrides the extension. 'csv' writes the findings alone.
processes Process ids or view names. Default: every process.
data_domains Restrict to these data domains.
scope 'cheap' (default): the checks a migration report runs, closed entities included. 'full' adds the entity and dataset scans, which read the storage tables.
display Print the summary and the findings. Default True.

The checks use no language model and change nothing. A finding names its fix and never runs it. An exported report names the checks it left out.

The order and input checks need the persisted lineage graph. When it is empty they are reported as not verified, never as passing:

tdfs4ds.rebuild_lineage_graph(all_data_domains=True)

Read the report

  1. Executive summary: the overall verdict, the main issues, and one row per process in execution order, with a cell per dimension: ok, the worst severity found, or n/a when the check did not run.
  2. Not verified: what could not be checked, and why. It is not a pass.
  3. Checks not run: under scope='cheap', the entity and dataset scans.

Fix in this order, because later findings can be symptoms of earlier ones:

  1. Lineage errors: a view or a process that no longer has what it reads.
  2. Refresh: not refreshable, then at risk.
  3. Run order and point-in-time inputs: values computed on the wrong inputs.
  4. Segments and SQL changed without a run: re-run the process.
  5. Entity keys, skew and distribution: these change storage, so plan them.

Can run() and roll_out() refresh this process?

run() and roll_out() refresh a process from what is registered: its view, managers and options. What was done around them is not replayed, and no error is raised.

usage = tdfs4ds.process_usage_for('<PROCESS_ID>', closed=True)   # closed=True also reads the storage tables

usage['verdict']        # 'refreshable', 'at risk', 'not refreshable' or 'not checked'
usage['reasons']
usage['findings']       # kind, label, severity, detail, fix
usage['unverifiable']
Verdict Meaning
refreshable No refresh finding, or information only. When storage_checked is false, the verdict comes from the run history only.
at risk At least one warning: a refresh may not reproduce the data.
not refreshable At least one error: a refresh only repeats the last state.
not checked The check did not run.
Finding What happened What to do
external_time_loop One execution wrote several business dates with no TimeManager. A TimeManager and one roll_out.
external_segment_loop One execution completed one date several times with no FilterManager. upload_features(..., filtermanager=fm), then run.
view_rewritten_between_runs The view was rewritten with a new literal for each run. Read the value from a manager.
recursive_query Recursion in the SQL chain. A date or sequence generator is a warning; walking a hierarchy is information. A TimeManager, or valid_time_column when the source holds the history.
closed_without_flag Entities have only closed periods while close_absent_entities is off. close_absent_entities=True if entities really leave; otherwise find what closes them.
validity_gap_without_flag A gap in an entity's history. A run leaves none, so a step outside it ended a period. Remove that step, then rebuild the history with roll_out(..., force_compute=True) from the first date.
writes_outside_run The query log shows writes to a FS_T_* table without the package's query band. Information only: removals and relocations write the same way. Check who wrote.

Never propose a loop or a custom step around run / roll_out, or a write to FS_T_*. See Stay inside the framework in fs-upload.

Limits: a loop whose runs fall in separate executions looks like a schedule. A loop calling roll_out one step at a time looks like a roll_out: only what its step did to storage shows, so ask for closed=True, or scope='cheap' or 'full', which include that read.

Before a migration

plan_migration(seeds, source, sanity='cheap') runs the same checks on the source store and shows them first in the report. They never block migrate_objects: a process that is not refreshable carries its problem to production, so fix it in the source first.

In the app

Operations → Workflow assessment runs the checks and downloads the report. The process card in Feature catalog shows the refresh verdict. The (?) button shows the matching script.

Full guide

Documentation: Design & operate → Assess workflow health.