Tracing Downstream Lineage

作者 astronomercbe1141f547b无许可证451 个星标收录于 2026年10月8日更新于 2026年10月8日仓库今天更新

Trace downstream data lineage and impact analysis. Use when the user asks what depends on this data, what breaks if something changes, downstream dependencies, or needs to assess change risk before modifying a table or DAG.

仅含说明Data & Analytics
AI 生成的概览

追踪下游数据血缘,评估表或 DAG 变更会造成哪些影响。

功能
该技能引导智能体对数据资产进行下游影响分析。它会依次查找直接消费方(如 DAG、视图和 BI 仪表板)、构建依赖树、按关键程度对下游资产分类、评估模式、数据和删除类变更的风险,并识别相关责任人。最终产出影响报告,包含摘要、影响关系图、详细影响与风险表格以及建议操作。
适用场景
在修改表或 DAG 之前使用,适用于用户询问某数据集有哪些依赖、变更会破坏什么或下游依赖有哪些的场景。其用途是在变更前进行变更风险评估。
运行要求
仅为说明性指令,不附带脚本。其中引用了 Astro CLI 命令 af dags list 和 af dags source、针对 information_schema 的 SQL 查询,以及访问 DAG 源代码和 BI 工具元数据。Astro 的 Lineage 标签页被提及为可选的辅助手段。

Downstream Lineage: Impacts

Answer the critical question: "What breaks if I change this?"

Use this BEFORE making changes to understand the blast radius.

Impact Analysis

Step 1: Identify Direct Consumers

Find everything that reads from this target:

For Tables:

  1. Search DAG source code: Look for DAGs that SELECT from this table

    • Use af dags list to get all DAGs
    • Use af dags source <dag_id> to search for table references
    • Look for: FROM target_table, JOIN target_table
  2. Check for dependent views:

    sql
    -- SnowflakeSELECT * FROM information_schema.view_table_usageWHERE table_name = '<target_table>'
    -- Or check SHOW VIEWS and search definitions
  3. Look for BI tool connections:

    • Dashboards often query tables directly
    • Check for common BI patterns in table naming (rpt_, dashboard_)

On Astro

If you're running on Astro, the Lineage tab in the Astro UI provides visual dependency graphs across DAGs and datasets, making downstream impact analysis faster. It shows which DAGs consume a given dataset and their current status, reducing the need for manual source code searches.

For DAGs:

  1. Check what the DAG produces: Use af dags source <dag_id> to find output tables
  2. Then trace those tables' consumers (recursive)

Step 2: Build Dependency Tree

Map the full downstream impact:

SOURCE: fct.orders    |    +-- TABLE: agg.daily_sales --> Dashboard: Executive KPIs    |       |    |       +-- TABLE: rpt.monthly_summary --> Email: Monthly Report    |    +-- TABLE: ml.order_features --> Model: Demand Forecasting    |    +-- DIRECT: Looker Dashboard "Sales Overview"

Step 3: Categorize by Criticality

Critical (breaks production):

  • Production dashboards
  • Customer-facing applications
  • Automated reports to executives
  • ML models in production
  • Regulatory/compliance reports

High (causes significant issues):

  • Internal operational dashboards
  • Analyst workflows
  • Data science experiments
  • Downstream ETL jobs

Medium (inconvenient):

  • Ad-hoc analysis tables
  • Development/staging copies
  • Historical archives

Low (minimal impact):

  • Deprecated tables
  • Unused datasets
  • Test data

Step 4: Assess Change Risk

For the proposed change, evaluate:

Schema Changes (adding/removing/renaming columns):

  • Which downstream queries will break?
  • Are there SELECT * patterns that will pick up new columns?
  • Which transformations reference the changing columns?

Data Changes (values, volumes, timing):

  • Will downstream aggregations still be valid?
  • Are there NULL handling assumptions that will break?
  • Will timing changes affect SLAs?

Deletion/Deprecation:

  • Full dependency tree must be migrated first
  • Communication needed for all stakeholders

Step 5: Find Stakeholders

Identify who owns downstream assets:

  1. DAG owners: Check owners field in DAG definitions
  2. Dashboard owners: Usually in BI tool metadata
  3. Team ownership: Look for team naming patterns or documentation

Output: Impact Report

Summary

"Changing fct.orders will impact X tables, Y DAGs, and Z dashboards"

Impact Diagram

                    +--> [agg.daily_sales] --> [Executive Dashboard]                    |[fct.orders] -------+--> [rpt.order_details] --> [Ops Team Email]                    |                    +--> [ml.features] --> [Demand Model]

Detailed Impacts

DownstreamTypeCriticalityOwnerNotes
agg.daily_salesTableCriticaldata-engUpdated hourly
Executive DashboardDashboardCriticalanalyticsCEO views daily
ml.order_featuresTableHighml-teamRetraining weekly

Risk Assessment

Change TypeRisk LevelMitigation
Add columnLowNo action needed
Rename columnHighUpdate 3 DAGs, 2 dashboards
Delete columnCriticalFull migration plan required
Change data typeMediumTest downstream aggregations

Recommended Actions

Before making changes:

  1. Notify owners: @data-eng, @analytics, @ml-team
  2. Update downstream DAG: transform_daily_sales
  3. Test dashboard: Executive KPIs
  4. Schedule change during low-impact window

Related Skills

  • Trace where data comes from: tracing-upstream-lineage skill
  • Check downstream freshness: checking-freshness skill
  • Debug any broken DAGs: debugging-dags skill
  • Add manual lineage annotations: annotating-task-lineage skill
  • Build custom lineage extractors: creating-openlineage-extractors skill

来源与署名

来源:astronomer/agents位于skills/tracing-downstream-lineage提交cbe1141

许可证: 无许可证

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架