analyzing-data

tarafından astronomer

Veri ambarınıza sorgu yaparak, önbelleğe alınmış desenler ve kavram eşlemeleriyle iş sorularını yanıtlayın. Tekrarlanan soru türleri için desen arama ve önbelleğe alma desteği sunar, gelecekteki sorguları iyileştirmek için sonuç kaydı yapar. Kavram-tablo eşleme önbelleği ve INFORMATION_SCHEMA veya kod tabanı grep aracılığıyla tablo şeması keşfi içerir. Analiz için Polars veya Pandas DataFrame'leri döndüren run_sql() ve run_sql_pandas() çekirdek fonksiyonlarını sağlar. Kavram, desen ve tablo önbelleklerini yönetmek için CLI komutları ve ayrıca...

npx skills add https://github.com/astronomer/agents --skill analyzing-data

Data Analysis

Answer business questions by querying the data warehouse. The kernel auto-starts on first exec call.

All CLI commands below are relative to this skill's directory. Before running any scripts/cli.py command, cd to the directory containing this file.

Workflow

  1. Pattern lookup — Check for a cached query strategy:

    uv run scripts/cli.py pattern lookup "<user's question>"
    

    If a pattern exists, follow its strategy. Record the outcome after executing:

    uv run scripts/cli.py pattern record <name> --success  # or --failure
    
  2. Concept lookup — Find known table mappings:

    uv run scripts/cli.py concept lookup <concept>
    
  3. Table discovery — If cache misses, search the codebase (Grep pattern="<concept>" glob="**/*.sql") or query INFORMATION_SCHEMA. See reference/discovery-warehouse.md.

  4. Execute query:

    uv run scripts/cli.py exec "df = run_sql('SELECT ...')"
    uv run scripts/cli.py exec "print(df)"
    
  5. Cache learnings — Always cache before presenting results:

    # Cache concept → table mapping
    uv run scripts/cli.py concept learn <concept> <TABLE> -k <KEY_COL>
    # Cache query strategy (if discovery was needed)
    uv run scripts/cli.py pattern learn <name> -q "question" -s "step" -t "TABLE" -g "gotcha"
    
  6. Present findings to user.

Kernel Functions

FunctionReturns
run_sql(query, limit=100)Polars DataFrame
run_sql_pandas(query, limit=100)Pandas DataFrame
run_sql_many(queries, limit=100)List of Polars DataFrames (one per query)

pl (Polars) and pd (Pandas) are pre-imported.

Run independent queries together with run_sql_many — they execute concurrently (Snowflake async / connection-pool fan-out) instead of one at a time:

uv run scripts/cli.py exec "dfs = run_sql_many(['SELECT ...', 'SELECT ...']); print(dfs[0])"

run_sql_many is fail-fast: if any query errors, the call raises and the results of the queries that succeeded are discarded. Use separate run_sql calls if you need partial results.

Timeouts: exec waits up to 120s by default, then interrupts the query and returns a "client stopped waiting" message (the query may still finish server-side). Raise it for known long-running queries: uv run scripts/cli.py exec "..." -t 600.

Idle kernel: the kernel self-terminates after 2h idle (preserving state until then). Override with ASTRO_KERNEL_IDLE_TIMEOUT (seconds; 0 disables).

CLI Reference

Kernel

uv run scripts/cli.py warehouse list      # List warehouses
uv run scripts/cli.py start [-w name]     # Start kernel (with optional warehouse)
uv run scripts/cli.py exec "..."          # Execute Python code
uv run scripts/cli.py status              # Kernel status
uv run scripts/cli.py restart             # Restart kernel
uv run scripts/cli.py stop                # Stop kernel
uv run scripts/cli.py install <pkg>       # Install package

Concept Cache

uv run scripts/cli.py concept lookup <name>                     # Look up
uv run scripts/cli.py concept learn <name> <TABLE> -k <KEY_COL> # Learn
uv run scripts/cli.py concept list                               # List all
uv run scripts/cli.py concept import -p /path/to/warehouse.md   # Bulk import

Pattern Cache

uv run scripts/cli.py pattern lookup "question"                                      # Look up
uv run scripts/cli.py pattern learn <name> -q "..." -s "..." -t "TABLE" -g "gotcha"  # Learn
uv run scripts/cli.py pattern record <name> --success                                # Record outcome
uv run scripts/cli.py pattern list                                                   # List all
uv run scripts/cli.py pattern delete <name>                                          # Delete

Table Schema Cache

uv run scripts/cli.py table lookup <TABLE>            # Look up schema
uv run scripts/cli.py table cache <TABLE> -c '[...]'  # Cache schema
uv run scripts/cli.py table list                       # List cached
uv run scripts/cli.py table delete <TABLE>             # Delete

Cache Management

uv run scripts/cli.py cache status                # Stats
uv run scripts/cli.py cache clear [--stale-only]  # Clear

References

astronomer tarafından daha fazla skill

airflow-state-store
astronomer
Persists task and asset state across retries and DAG runs using Airflow 3.3's AIP-103 key/value stores (`task_state_store`, `asset_state_store`) and the…
creating-openlineage-extractors
astronomer
Özel OpenLineage çıkarıcıları, desteklenmeyen Airflow operatörleri ve karmaşık lineage senaryoları için. İki yaklaşım: sahip olduğunuz operatörlere doğrudan OpenLineage yöntemleri eklemek (önerilen) veya değiştiremeyeceğiniz üçüncü taraf operatörler için özel çıkarıcılar oluşturmak. Çıkarıcılar, operatör yürütmesini üç noktada keser: statik lineage için yürütmeden önce, çalışma zamanında belirlenen çıktılar için başarıdan sonra ve isteğe bağlı olarak kısmi lineage için başarısızlıktan sonra. Çıkarıcıları airflow.cfg veya ortam değişkenleri aracı
debugging-dags
astronomer
Sistematik kök neden analizi ve başarısız Airflow DAG'leri için yapılandırılmış soruşturma iş akışlarıyla düzeltme. Dört adımlı teşhis sürecinde rehberlik eder: hatayı belirleme, hata ayrıntılarını çıkarma, bağlamsal bilgi toplama ve uygulanabilir düzeltme adımları sunma. Hataları dört türe (veri, kod, altyapı, bağımlılık) kategorize ederek soruşturmayı odaklar ve uygun düzeltmeler önerir. Günlük alma, çalıştırma karşılaştırması, görev temizleme ve DAG... için kullanıma hazır CLI komutları sağlar.
delegating-to-otto
astronomer
Drives Astronomer's Otto agent (`astro otto`) as a delegated sub-agent for Airflow, dbt, and data-engineering work. Use when the user explicitly asks to "use…
deploying-airflow
astronomer
Airflow DAG'larını ve projelerini dağıtın. Kullanıcı kod dağıtmak, DAG'ları göndermek, CI/CD kurmak, üretime dağıtmak veya dağıtım stratejileri hakkında soru sorduğunda kullanın…
deploying-go-sdk-bundles
astronomer
Derlenmiş Airflow Go SDK paketlerini derler, paketler ve dağıtır, böylece ExecutableCoordinator bunları çalıştırabilir. Kullanıcı bir Go görev paketini derlemek istediğinde, sorduğunda…
testing-dags
astronomer
Airflow DAG'leri için kapsamlı hata teşhisi ile yinelemeli test-hata ayıklama-düzeltme döngüleri. Bir DAG'ı çalıştırmak ve tamamlanmasını beklemek için af runs trigger-wait <dag_id> ile başlayın; ön kontrol gerekmez. Hata durumunda, kapsamlı hata özeti için af runs diagnose ve belirli görevlerden hata detaylarını incelemek için af tasks logs kullanın. Özel yapılandırma, zaman aşımları ve yeniden deneme girişimlerini destekler; başarı, hata ve zaman aşımı senaryolarını net yanıt yorumlama ile ele alır. Hızlı doğrulama mevcuttur...
tracing-downstream-lineage
astronomer
Tablo veya DAG'leri değiştirmeden önce aşağı yönlü veri soyunu izleyerek değişiklik etkisini değerlendirir. Kaynak kod araması, görünüm bağımlılıkları ve BI araç bağlantıları aracılığıyla hedef tablo veya DAG'in doğrudan tüketicilerini belirler. Tablolardan panolara ve ML modellerine kadar tüm aşağı yönlü etkileri haritalayan tam bir bağımlılık ağacı oluşturur. Bağımlılıkları kritiklik düzeyine (kritik, yüksek, orta, düşük) göre kategorize ederek paydaş iletişimi ve test önceliklendirmesini sağlar. Risk değerlendirmesi ve etkilenen... içeren