Skip to content

Make {{ profile }} available to Jinja in blueprint vars - #85

Merged
jeremybeard merged 1 commit into
mainfrom
fix-vars-profile-context
Sep 21, 2026
Merged

jeremybeard merged 1 commit into
mainfrom
fix-vars-profile-context

Conversation

@jeremybeard

Copy link
Copy Markdown
Collaborator

blueprint vars --profile <name> fails on any DAG whose YAML references {{ profile }}, with Configuration Error ... Jinja2 template rendering failed: 'profile' is undefined. Such a DAG parses and lints without complaint, so only inspection was broken.

render_yaml_template builds its Jinja context with StrictUndefined, so the active profile must be passed in explicitly. show_vars was the only one of the four call sites that did not — Builder.build_dag (builder.py:336), build_all (builder.py:673) and validate_yaml, behind blueprint lint (loaders.py:302), all pass context={"profile": profile}.

Verified by reverting only the cli.py change with the new test in place: it fails with the reported error, and passes with the fix. Full unit suite is green (422 tests); ruff and ty clean.

render_yaml_template builds its context with StrictUndefined, so the
active profile has to be passed in explicitly. show_vars was the only
one of the four call sites that did not, so a DAG using {{ profile }}
parsed and linted fine but could not be inspected.
@astronomer astronomer deleted a comment from github-actions Bot Sep 18, 2026
@jeremybeard
jeremybeard marked this pull request as ready for review September 18, 2026 16:20
@jeremybeard
jeremybeard requested a review from a team as a code owner September 18, 2026 16:20
@jeremybeard
jeremybeard marked this pull request as draft September 18, 2026 16:31
@jeremybeard
jeremybeard marked this pull request as ready for review September 18, 2026 16:52
@jeremybeard
jeremybeard merged commit ed5d78f into main Sep 21, 2026
15 checks passed
@jeremybeard
jeremybeard deleted the fix-vars-profile-context branch September 21, 2026 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants