Skip to content

Conversation

@sjrl
Copy link
Contributor

@sjrl sjrl commented Nov 18, 2025

Related Issues

Proposed Changes:

While investigating #9916 I found this open issue pallets/jinja#2069 in the Jinja2 library which is the cause of our issue.

I've developed a partial workaround by introducing the utility method _collect_assigned_variables. The work around is partial because it does not exhaustively identify all types of assignment. It only covers regular assignment, list and tuple assignments.

I wonder if it would be better to hard-pin jinja2<=3.15 to completely avoid this issue.

How did you test it?

Added new tests.

Notes for the reviewer

Checklist

  • I have read the contributors guidelines and the code of conduct.
  • I have updated the related issue with new insights and changes.
  • I have added unit tests and updated the docstrings.
  • I've used one of the conventional commit types for my PR title: fix:, feat:, build:, chore:, ci:, docs:, style:, refactor:, perf:, test: and added ! in case the PR includes breaking changes.
  • I have documented my code.
  • I have added a release note file, following the contributors guidelines.
  • I have run pre-commit hooks and fixed any issue.

@vercel
Copy link

vercel bot commented Nov 18, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
haystack-docs Ignored Ignored Nov 18, 2025 10:36am

@github-actions github-actions bot added topic:tests type:documentation Improvements on the docs labels Nov 18, 2025
@sjrl
Copy link
Contributor Author

sjrl commented Nov 18, 2025

Closing in favor of a new PR to pin jinja2 after an offline discussion

@sjrl sjrl closed this Nov 18, 2025
@sjrl
Copy link
Contributor Author

sjrl commented Nov 18, 2025

Reopening since we found that pinning jinja2 to 3.1.4 doesn't fully solve the issue. Find more information here pallets/jinja#2069 (comment)

@sjrl sjrl reopened this Nov 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

topic:tests type:documentation Improvements on the docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PromptBuilder incorrectly marks internally set Jinja2 variables as required inputs when using `required_variables='*'

2 participants