analyzing-data
Queries the data warehouse with SQL and answers business questions about data. Use when answering anything that needs warehouse data - counts, metrics, trends, aggregations, joins across tables, data lookups, or ad-hoc SQL analysis (for example "who uses X", "how many Y", "show me Z", "find customer
By astronomer · 1,343 installs
npx skills add astronomer/agents --skill analyzing-data
Source repository · Upstream listing
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:
If a pattern exists, follow its strategy. Record the outcome after executing:
2. Concept lookup — Find known table mappings:
3. Table discovery — If cache misses, search the codebase ( Grep pattern="<concept " glob=" / .sql" ) or query INFORMATION SCHEMA . See [reference/discovery warehouse.md](reference/discovery warehouse.md).
4. Execute query :
5. Cache learnings — Always cache before presenting results:
6. Present findings to user.
Kernel Functions
Function Returns
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:
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
Concept Cache
Pattern Cache
Table Schema Cache
Cache Management
References
[reference/discovery warehouse.md](reference/discovery warehouse.md) — Large table handling, warehouse exploration, INFORMATION SCHEMA queries
[reference/common patterns.md](reference/common patterns.md) — SQL templates for trends, comparisons, top N, distributions, cohorts