tracing-upstream-lineage

द्वारा astronomer

अपस्ट्रीम डेटा वंशावली का पता लगाकर किसी तालिका या स्तंभ को फीड करने वाले स्रोतों, DAGs और निर्भरताओं की पहचान करें। तीन लक्ष्य प्रकारों को ट्रेस करने का समर्थन करता है: तालिकाएँ, स्तंभ और DAGs; उत्पादक पाइपलाइनों को खोजने के लिए Airflow DAG स्रोत कोड और कार्य निरीक्षण का उपयोग करता है। SQL स्रोतों (FROM खंड), बाहरी सिस्टम (S3, Postgres, Salesforce, HTTP APIs) और फ़ाइल-आधारित स्रोतों को संभालता है; अपस्ट्रीम श्रृंखल

npx skills add https://github.com/astronomer/agents --skill tracing-upstream-lineage

Upstream Lineage: Sources

Trace the origins of data - answer "Where does this data come from?"

Lineage Investigation

Step 1: Identify the Target Type

Determine what we're tracing:

  • Table: Trace what populates this table
  • Column: Trace where this specific column comes from
  • DAG: Trace what data sources this DAG reads from

Step 2: Find the Producing DAG

Tables are typically populated by Airflow DAGs. Find the connection:

  1. Search DAGs by name: Use af dags list and look for DAG names matching the table name

    • load_customers -> customers table
    • etl_daily_orders -> orders table
  2. Explore DAG source code: Use af dags source <dag_id> to read the DAG definition

    • Look for INSERT, MERGE, CREATE TABLE statements
    • Find the target table in the code
  3. Check DAG tasks: Use af tasks list <dag_id> to see what operations the DAG performs

On Astro

If you're running on Astro, the Lineage tab in the Astro UI provides visual lineage exploration across DAGs and datasets. Use it to quickly trace upstream dependencies without manually searching DAG source code.

On OSS Airflow

Use DAG source code and task logs to trace lineage (no built-in cross-DAG UI).

Step 3: Trace Data Sources

From the DAG code, identify source tables and systems:

SQL Sources (look for FROM clauses):

# In DAG code:
SELECT * FROM source_schema.source_table  # <- This is an upstream source

External Sources (look for connection references):

  • S3Operator -> S3 bucket source
  • PostgresOperator -> Postgres database source
  • SalesforceOperator -> Salesforce API source
  • HttpOperator -> REST API source

File Sources:

  • CSV/Parquet files in object storage
  • SFTP drops
  • Local file paths

Step 4: Build the Lineage Chain

Recursively trace each source:

TARGET: analytics.orders_daily
    ^
    +-- DAG: etl_daily_orders
            ^
            +-- SOURCE: raw.orders (table)
            |       ^
            |       +-- DAG: ingest_orders
            |               ^
            |               +-- SOURCE: Salesforce API (external)
            |
            +-- SOURCE: dim.customers (table)
                    ^
                    +-- DAG: load_customers
                            ^
                            +-- SOURCE: PostgreSQL (external DB)

Step 5: Check Source Health

For each upstream source:

  • Tables: Check freshness with the checking-freshness skill
  • DAGs: Check recent run status with af dags stats
  • External systems: Note connection info from DAG code

Lineage for Columns

When tracing a specific column:

  1. Find the column in the target table schema
  2. Search DAG source code for references to that column name
  3. Trace through transformations:
    • Direct mappings: source.col AS target_col
    • Transformations: COALESCE(a.col, b.col) AS target_col
    • Aggregations: SUM(detail.amount) AS total_amount

Output: Lineage Report

Summary

One-line answer: "This table is populated by DAG X from sources Y and Z"

Lineage Diagram

[Salesforce] --> [raw.opportunities] --> [stg.opportunities] --> [fct.sales]
                        |                        |
                   DAG: ingest_sfdc         DAG: transform_sales

Source Details

SourceTypeConnectionFreshnessOwner
raw.ordersTableInternal2h agodata-team
SalesforceAPIsalesforce_connReal-timesales-ops

Transformation Chain

Describe how data flows and transforms:

  1. Raw data lands in raw.orders via Salesforce API sync
  2. DAG transform_orders cleans and dedupes into stg.orders
  3. DAG build_order_facts joins with dimensions into fct.orders

Data Quality Implications

  • Single points of failure?
  • Stale upstream sources?
  • Complex transformation chains that could break?

Related Skills

  • Check source freshness: checking-freshness skill
  • Debug source DAG: debugging-dags skill
  • Trace downstream impacts: tracing-downstream-lineage skill
  • Add manual lineage annotations: annotating-task-lineage skill
  • Build custom lineage extractors: creating-openlineage-extractors skill

astronomer की और Skills

airflow
astronomer
Apache Airflow DAGs, रन, टास्क और सिस्टम कॉन्फ़िगरेशन को क्वेरी, प्रबंधित और समस्या निवारण करें। DAG निरीक्षण, रन प्रबंधन, टास्क लॉगिंग, कॉन्फ़िगरेशन क्वेरी और सीधे REST API एक्सेस में 30+ कमांड का समर्थन करता है। स्थायी कॉन्फ़िगरेशन के साथ कई Airflow इंस्टेंस प्रबंधित करें; स्थानीय और Astro डिप्लॉयमेंट को स्वचालित रूप से खोजें। DAG रन को सिंक्रोनस (पूर्णता की प्रतीक्षा करें) या एसिंक्रोनस रूप से
official
airflow-hitl
astronomer
एयरफ्लो डीएजी में डिफरेबल ऑपरेटरों का उपयोग करके मानव अनुमोदन गेट, फॉर्म इनपुट और ब्रांचिंग। चार ऑपरेटर प्रकार: अनुमोदन/अस्वीकृति निर्णयों के लिए ApprovalOperator, फॉर्म के साथ बहु-विकल्प चयन के लिए HITLOperator, मानव-संचालित कार्य रूटिंग के लिए HITLBranchOperator, और फॉर्म डेटा संग्रह के लिए HITLEntryOperator। सभी ऑपरेटर डिफरेबल हैं, जो एयरफ्लो यूआई के आवश्यक कार्रवाई टैब या REST API के माध्यम
official
airflow-plugins
astronomer
Airflow 3.1+ प्लगइन्स बनाएँ जो FastAPI ऐप्स, कस्टम UI पेज, React कम्पोनेंट्स, मिडलवेयर, मैक्रोज़ और ऑपरेटर लिंक्स को सीधे Airflow UI में एम्बेड करते हैं। उपयोग करें…
official
analyzing-data
astronomer
अपने डेटा वेयरहाउस से कैश्ड पैटर्न और कॉन्सेप्ट मैपिंग के साथ व्यावसायिक प्रश्नों के उत्तर प्राप्त करें। बार-बार पूछे जाने वाले प्रश्नों के लिए पैटर्न लुकअप और कैशिंग का समर्थन करता है, जिसमें भविष्य के प्रश्नों को बेहतर बनाने के लिए परिणाम रिकॉर्डिंग शामिल है। इसमें कॉन्सेप्ट-टू-टेबल मैपिंग कैश और INFORMATION_SCHEMA या कोडबेस grep के माध्यम से टेबल स्कीमा डिस्कवरी शामिल है। विश्लेषण के लिए
official
annotating-task-lineage
astronomer
Airflow कार्यों को इनलेट और आउटलेट का उपयोग करके डेटा लाइनेज के साथ एनोटेट करें। डेटाबेस, डेटा वेयरहाउस और क्लाउड स्टोरेज में इनपुट और आउटपुट परिभाषित करने के लिए OpenLineage Dataset ऑब्जेक्ट, Airflow Assets और Airflow Datasets का समर्थन करता है। जब ऑपरेटरों में बिल्ट-इन OpenLineage एक्सट्रैक्टर न हों तो फ़ॉलबैक के रूप में उपयोग करें; चार-स्तरीय प्राथमिकता प्रणाली का पालन करता है जहाँ कस्टम एक्सट्रैक्टर और OpenLineage
official
authoring-dags
astronomer
Apache Airflow DAGs बनाने के लिए निर्देशित कार्यप्रवाह, जिसमें सत्यापन और परीक्षण एकीकरण शामिल है। संरचित छह-चरणीय दृष्टिकोण: वातावरण और मौजूदा पैटर्न की खोज करें, DAG संरचना की योजना बनाएं, सर्वोत्तम प्रथाओं का पालन करते हुए कार्यान्वित करें, af CLI कमांड से सत्यापित करें, उपयोगकर्ता की सहमति से परीक्षण करें, और सुधारों पर पुनरावृत्ति करें। खोज के लिए CLI कमांड (af config connections, af config providers, af dags list) और सत्यापन के लिए (af d
official
blueprint
astronomer
Pydantic सत्यापन के साथ पुन: प्रयोज्य Airflow कार्य समूह टेम्पलेट परिभाषित करें और YAML से DAGs संकलित करें। blueprint टेम्पलेट बनाते समय, DAGs संकलित करते समय उपयोग करें…
official
checking-freshness
astronomer
तालिका टाइमस्टैम्प और अद्यतन पैटर्न की जांच करके एक स्टेलनेस स्केल के विरुद्ध डेटा ताजगी सत्यापित करता है। सामान्य ETL नामकरण पैटर्न ( _loaded_at , _updated_at , created_at , आदि) का उपयोग करके टाइमस्टैम्प कॉलम की पहचान करता है और आयु निर्धारित करने के लिए उनके अधिकतम मानों को क्वेरी करता है। डेटा को चार ताजगी स्थितियों में वर्गीकृत करता है: ताजा (< 4 घंटे), बासी (4–24 घंटे), बहुत बासी (> 24 घंटे), य
official