I am at step 5.1.2 ( In the template.py
file replace each occurrence of the DAG name model_trip_duration_easy_destiny
with the Jinja template: {{ dag_name }}
…)
e.g. def {{ jinja syntax }} ():
When I try to define the function inside template.py using jinja template syntax, it shows me parsing failed/invalid syntax…
Any suggestions/advice ?
After recopying and reloading the template file, the syntax
error somehow went away and I am not sure how, the
function definition is still the way I had it earlier, but, looks
like, I will be able to move forward…
Hello @Rajeev_Prabhakar,
The def {{ jinja syntax }} (): should not have a space between the jinja syntax and (). That is because the generate_dags
will try to create three different files with their respective names that replace the jinja syntax. The correct function name will be generated by the generate_dags
and that syntax error in the function name will go away in the new generated files.
e.g. def model_trip_duration_easy_destiny() I hope it helps