Trace a metric back to its source tables
`anfra lineage` and `Anfra.lineage()` show what a metric or field is built from: the fields it uses, their models and the tables behind them.
Name each field by what holds it, a dataset and its metric or a model and its field:
anfra lineage --targets '[{"parent":"ecommerce","child":"revenue"}]'In a Data App, Anfra.lineage() returns the same trace as a diagram of cards in layers, upstream first, for a definitions panel next to a chart:
const { results: [revenue] } = await Anfra.lineage([{ parent: 'ecommerce', child: 'revenue' }])Lineage reads the catalog that anfra ingest builds, so run anfra ingest again after you change a model or dataset.