feat(warehouse): add adaptive warehouse support#36
Open
GClunies wants to merge 1 commit into
Open
Conversation
Adaptive warehouses let Snowflake pick size and cluster count automatically, capped by MAX_QUERY_PERFORMANCE_LEVEL instead of WAREHOUSE_SIZE/MIN|MAX_CLUSTER_COUNT. Follows the Gen2 single-class pattern: ADAPTIVE joins WarehouseType, max_query_performance_level reuses WarehouseSize (XSMALL..X4LARGE, X5/X6LARGE rejected), and a shared ADAPTIVE_UNSUPPORTED_FIELDS set drives both __post_init__ validation (defaults read from dataclasses.fields) and fetch_warehouse null-normalization so SHOW WAREHOUSES output round-trips without spurious drift. CREATE renders via the documented-equivalent WAREHOUSE_TYPE = 'ADAPTIVE' form, so no lifecycle override or new resource class is needed. Both STANDARD<->ADAPTIVE conversion deltas are pinned by tests, and plan fails fast on conversions Snowflake doesn't support (to or from X5LARGE/X6LARGE). Grants need no changes (grant code keys only on ResourceType.WAREHOUSE) and are covered by a test. Docs are updated in the Warehouse docstring and regenerated.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds support for Snowflake adaptive warehouses (closes #27). Adaptive warehouses are declarable in YAML/Python via
warehouse_type: ADAPTIVEwithmax_query_performance_level, replacing the ~11 warehouses we currently manage through one-off SQL. Follows the Gen2 single-class pattern from #22.Changes
WarehouseType.ADAPTIVE;max_query_performance_leveltyped asOptional[WarehouseSize](XSMALL–X4LARGE per Snowflake docs; X5/X6LARGE rejected, default left to Snowflake = XLARGE)warehouse_size, cluster counts, scaling policy, suspend/resume, query acceleration, resource constraint, generation) via a singleADAPTIVE_UNSUPPORTED_FIELDSset, with real defaults read fromdataclasses.fieldsfetch_warehouseround-tripsSHOW WAREHOUSESoutput for adaptive warehouses with no spurious drift, reusing the same field set; tolerates SHOW output that lacks the new adaptive columnsCREATE WAREHOUSE ... WITH WAREHOUSE_TYPE = 'ADAPTIVE' MAX_QUERY_PERFORMANCE_LEVEL = ...(documented-equivalent form) — no lifecycle override or new resource classsize: Nonefor adaptive warehousesNotes
QUERY_THROUGHPUT_MULTIPLIERintentionally not modeled (out of scope; fetch omits it so out-of-band values can't cause drift)tools/generate_resource_docs.pyhas pre-existing template drift (blank frontmatter description, missing CLI-label slot) that would wipe content from all resource pages on the next full regen — worth its own fix; this PR hand-restored the two affected lines onwarehouse.md1564 unit tests passing; ruff and mypy clean.