Implement JIT query rendering to avoid rendering unused templates#6
Merged
jeffreyaven merged 1 commit intomainfrom Feb 12, 2026
Merged
Conversation
Previously, get_queries() rendered ALL query templates upfront (exists, create, update, delete, exports, etc.) regardless of which operation was being run. This caused failures when a template referenced variables not yet available in the context - e.g., a delete query referencing an export variable (databricks_credentials_id) that only gets populated after the exports query runs. Changed to JIT (just-in-time) rendering: - get_queries() now only loads and parses templates without rendering - ParsedQuery stores the raw template instead of a pre-rendered string - Each command (build, teardown, test) renders templates on demand via render_query() only when the query is actually needed - Added render_query() to CommandRunner for convenient JIT rendering This matches how the Python version works in practice - Jinja2 is more forgiving with missing variables, but the proper fix is to only render what you need, when you need it. https://claude.ai/code/session_01ShAyjRLWBYC3tPsusCxggv
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.
Previously, get_queries() rendered ALL query templates upfront (exists, create, update, delete, exports, etc.) regardless of which operation was being run. This caused failures when a template referenced variables not yet available in the context - e.g., a delete query referencing an export variable (databricks_credentials_id) that only gets populated after the exports query runs.
Changed to JIT (just-in-time) rendering:
This matches how the Python version works in practice - Jinja2 is more forgiving with missing variables, but the proper fix is to only render what you need, when you need it.
https://claude.ai/code/session_01ShAyjRLWBYC3tPsusCxggv