Hello FME Community,
I’m encountering a puzzling issue with a Jinja2 template that I’m running through the PythonCaller in FME Flow. The template works perfectly fine on my local machine, but when I deploy the same script on FME Flow, I receive the following error:
Python Exception <TemplateSyntaxError>: expected token 'end of print statement', got 'X'
Context:
The Jinja2 template is used to generate a Contract document with placeholders that are populated at runtime. Below is a simplified version of the template:
Contract
1. A Person with these Details2. Name:
{{ tag1 }}
Postcode:{{ tag2 }}
Date of Birth:{{ tag3 }}
E-mailadres:{{ tag4 }}
{% for compensation in compensation%}
located at the* / the*:{{ fee.tag70 }}
section:{{ fee.tag4 }}
number(s):{{ fee.tag5 }}
{% endfor %}
Steps Taken:
- Local Testing: The template renders correctly when I run it locally using Python (same Jinja2 template) on my machine.
- FME Flow Execution: When running the same script on FME Flow, it fails with the TemplateSyntaxError mentioned above.
- Data Consistency: I confirmed that all necessary data tags are populated and passed correctly to the template.
Request for Help:
I'm reaching out to see if anyone in the community has encountered a similar issue or might have insights into what could be going wrong. Specifically:
- Has anyone experienced differences in how Jinja2 templates are processed between local Python environments and FME Flow?
- Are there known issues or configuration settings in FME Flow that might cause this behavior?
- Any tips on how to further debug this issue within the FME Flow environment?
Thanks in advance for your help.