trace-column-level-lineage
Use when you need to know which source columns and jobs produced a downstream value. Builds column-level lineage from parsed transforms so impact analysis and debugging are answerable.
- License 许可
- MIT
- 最近更新
- 2026-11-15
- Stars
- ★ 81
- Forks
- 17
01 前言 Front Matter
- name
- trace-column-level-lineage
- description
- Use when you need to know which source columns and jobs produced a downstream value. Builds column-level lineage from parsed transforms so impact analysis and debugging are answerable.
02 资源文件 3
- 许可证LICENSE1.0 KB
- 参考文档SOURCE.md352 B
- 参考文档TRUST.auto.yaml2.1 KB
03 SKILL.md 正文
Trace Column-Level Lineage
Table-level lineage (a dashboard reads orders) cannot answer which metrics break when orders.currency is wrong. Column-level lineage maps each output column back to its inputs and the job that wrote it.
Procedure
- Start from the DAG you already have: orchestration metadata (
dbt manifest.json, an Airflow DAG, a Dagster asset graph) gives job-to-job edges. - Parse each model's SQL for column edges with
sqlglot:sqlglot.lineage.lineage("amount", expression, schema=schema)andsqlglot.parse_one(sql).find_all(exp.Column). For dbt,dbt docs generatewritesmanifest.jsonwithparent_map/child_mapand compiled SQL to parse. - For non-SQL transforms, annotate the code with the columns read and written (a decorator or a manifest). A transform you cannot parse must declare its lineage.
- Store edges as tuples:
(source_table, source_col, target_table, target_col, job). - Query in both directions: upstream of a column (what feeds it) and downstream (what it feeds).
- Use it operationally: before changing a source column, list downstream columns and their owning jobs; during an incident, show which job last wrote a bad value.
- Refresh lineage on every deploy so it does not rot. An unmaintained lineage graph is worse than none because it is trusted.
- Store the edge graph in a queryable store (SQLite/Postgres), not a static image, so it can be joined against alerts and ownership.
- Resolve ambiguity by qualifying columns with their table alias during parsing, so a stored edge names the right source.
- Fail the build if a model cannot be parsed for lineage, so a wildcard or an odd syntax is flagged rather than silently unlinked.
Pitfalls
- Wildcard
SELECT *hides edges; expand columns at parse time or the graph is empty for that model. - Renaming a column in a transform without updating lineage silently detaches the edge.
- Views and CTEs that alias columns break naive name matching; parse, do not regex.
- Lineage derived once and never refreshed points at deleted tables.
- Columns with the same name across a join are ambiguous and need qualified resolution.
- Treating lineage as documentation only, with no queryable store, means it is never used during an incident.
- Parsing only the final model misses intermediate CTEs that rename a column on the way through.
- An unparseable transform that is skipped makes the graph look complete when it has a hole.
Verification
python -c "import sqlglot; print(sqlglot.lineage.lineage('revenue', sql, schema=s))"
sqlite3 lineage.db "SELECT * FROM edges WHERE target_col='revenue'"
A known source column resolves to the expected target through named jobs; an intentionally broken column returns no path, proving detection works. Report the edge count and the downstream columns of the changed source.
04 同仓库更多 Skills
troves
Deposit and withdraw from Troves DeFi yield vault strategies on Starknet. View available strategies, check positions, and manage vault deposits. Use this skill when the user mentions Troves, vault, yield vault, DeFi vault, strategy, yield farming, vault deposit, vault withdraw, earning yield through vaults, passive yield strategies, or wants to deposit into or withdraw from a yield strategy — even if they don't say "Troves" explicitly.
trade
Swap tokens on Starknet via Fibrous DEX aggregator. Supports per-provider selection (avnu, ekubo, or auto to race all). Use this skill when the user wants to swap, exchange, trade, convert, buy, or sell one token for another on Starknet. Also use when the user asks about token prices, exchange rates, DEX routing, best swap route, or wants to check how much they would receive for a given amount — even if they don't explicitly say "swap".
staking
Stake, unstake, claim, and compound rewards for STRK, WBTC, tBTC, SolvBTC, and LBTC on Starknet. View validators, pools, and staking positions. Use this skill when the user mentions staking, delegating, validators, staking pools, rewards, compounding, unstaking, earning yield, passive income on crypto, or wants to earn on their STRK or BTC tokens — even if they don't say "stake" explicitly.
send
Send STRK, ETH, or any ERC-20 token to a Starknet address. Supports simulation (dry-run) before execution. Use this skill when the user wants to send, transfer, pay, tip, or move tokens to another wallet address on Starknet. Also trigger when the user mentions sending funds to someone, making a payment, transferring assets, or moving crypto to a specific address — even if they just say "pay 10 STRK to 0x...".
portfolio
View a comprehensive DeFi portfolio dashboard and optimize portfolio allocation via automated rebalancing. Use this skill when the user wants an overview, summary, dashboard, total value, net worth, portfolio rebalancing, target allocation, or wants to see all their DeFi positions across Starknet at once. Also trigger when the user asks "what do I have", "show me everything", "how much am I worth", "my positions", "my investments", "rebalance my portfolio", "I want 50% ETH", "optimize my holdings", or any request for a holistic view of their Starknet holdings — even if they don't explicitly say "portfolio".
multi-swap
Execute multiple token swaps in a single Starknet transaction via Fibrous (default). Supports per-provider selection (avnu, ekubo, or auto to race all). Supports 2-3 swap pairs bundled into one multicall. Use this skill when the user wants to swap multiple token pairs at once, do batch swaps, execute several trades simultaneously, perform parallel swaps, or do bulk trading in one transaction. Also trigger when the user mentions "two swaps", "three swaps", "swap X and Y at the same time", or wants to convert multiple tokens in a single call.