query_dataset
Query one topic's gold facts with dimension labels joined in (the district/school/county/demographic names come back on every row). filters is a dict of column → value or list-of-values: FK codes (district_code, school_code, county_fips, demographic) and any categorical column — see describe_dataset's filters for the exact keys and enum values. Use year (exact) OR year_min/year_max (range), never both. detail picks the grain (default is the finest available). Returns rows plus a columns descriptor array (type/role/unit/null-meaning, and is_key_metric flagging the headline column) so you interpret values and NULLs correctly — NULL usually means SUPPRESSED, not zero (see null_semantics). The top-level key_metric echoes which column is the answer. Use columns to project a subset, include_labels=false to skip the joined name columns (codes only), and order_by+order for server-side top-N instead of over-fetching. Pages are small (default 100, max 500); when truncated is true a bulk_export block points at the REST CSV/Parquet endpoint and the source path for the full pull — do not loop pagination to dump a table. A bad filter returns a self-describing error listing the valid keys/values.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| year | No | Exact year. Use this OR year_min/max. | |
| limit | No | Page size (default 100, max 500). | |
| order | No | Sort direction for order_by: 'asc' or 'desc'. | asc |
| topic | Yes | Topic name, e.g. 'act_scores'. | |
| detail | No | Grain (e.g. schools/districts/states); default finest. | |
| offset | No | Row offset for paging (>= 0). | |
| columns | No | Project only these output columns (fact columns + joined label columns). Smaller pages / fewer column reads. Omit for all columns. | |
| filters | No | Column → value (or list of values) filters. Keys are FK columns (district_code, school_code, county_fips, demographic) and categorical columns; read describe_dataset's `filters` for the exact keys and enum values FIRST. A value list is a union (OR); multiple keys AND together. A wrong key/value returns a self-describing error listing the valid ones. | |
| order_by | No | Order by one fact column or joined label column (for server-side top-N). Default order is the row grain. NULL (suppressed) cells sort LAST in either direction, so a metric top-N is never polluted by suppressed rows. | |
| year_max | No | Inclusive upper year bound (range). | |
| year_min | No | Inclusive lower year bound (range). | |
| main_topic | No | Main topic: 'education' or 'census'. | education |
| include_labels | No | Join district/school/county/demographic name columns (default true); false = codes only (faster, leaner). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||