[ 
https://issues.apache.org/jira/browse/AIRFLOW-4833?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16875268#comment-16875268
 ] 

Francesco Macagno commented on AIRFLOW-4833:
--------------------------------------------

Nice find, adding the extra options certainly seems worthwhile.

What i am particularly curious about though is why `keep_trailing_newline` 
defaults to false in the first place. It doesn't seem like it gets you 
anything? It might be worth just setting it to true, if adding the jinja 
options to the dag seems like too much of a commitment.

> Jinja templating removes newlines
> ---------------------------------
>
>                 Key: AIRFLOW-4833
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-4833
>             Project: Apache Airflow
>          Issue Type: Bug
>          Components: operators
>    Affects Versions: 1.10.2
>            Reporter: Francesco Macagno
>            Priority: Minor
>
> When using an operator that has Jinja templating enabled for a field, if the 
> field value ends with a newline then the newline is removed, regardless of 
> whether there was a template in the string.
>  
> This came up when attempting to send data to Prometheus pushgateway using the 
> SimpleHttpOperator. Pushgateway requires a newline at the end of every entry, 
> so the removal of the newline at the end of the data parameter causes the 
> request to fail in a way that is difficult to debug.
>  
> This can be gotten around by including a space after the newline character, 
> though this is not a great solution. The space is ignored by pushgateway.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to