uranusjr commented on code in PR #35017:
URL: https://github.com/apache/airflow/pull/35017#discussion_r1364213778


##########
docs/apache-airflow/core-concepts/operators.rst:
##########
@@ -185,10 +185,22 @@ This will fail with ``TemplateNotFound: cat script.sh``, 
but we can prevent airf
 
     fixed_print_script = BashOperator(
         task_id="fixed_print_script",
-        bash_callable="cat script.sh",
+        bash_command="cat script.sh",
     )
     fixed_print_script.template_ext = ()
 
+
+It is also possible to exclude a string from templating and use it directly by 
wrapping it in
+:class:`~airflow.template.templater.LiteralValue`. This approach disables the 
rendering of both macros and files and
+can be applied to selected nested fields, while retaining the default 
templating rules for the remainder of the content.
+
+.. code-block:: python
+
+    fixed_print_script = BashOperator(
+        task_id="fixed_print_script",
+        bash_command=LiteralValue("cat script.sh"),
+    )
+

Review Comment:
   It’d be a good idea to add a `.. versionadded` marker somewhere around here.
   
   Also, [`airflow.template.templater` is not a public 
module](https://airflow.apache.org/docs/apache-airflow/stable/public-airflow-interface.html),
 and I’m not sure if we want to open it up (all its other contents are 
private); we may want to move the class somewhere else.



##########
docs/apache-airflow/core-concepts/operators.rst:
##########
@@ -185,10 +185,22 @@ This will fail with ``TemplateNotFound: cat script.sh``, 
but we can prevent airf
 
     fixed_print_script = BashOperator(
         task_id="fixed_print_script",
-        bash_callable="cat script.sh",
+        bash_command="cat script.sh",
     )
     fixed_print_script.template_ext = ()
 
+
+It is also possible to exclude a string from templating and use it directly by 
wrapping it in
+:class:`~airflow.template.templater.LiteralValue`. This approach disables the 
rendering of both macros and files and
+can be applied to selected nested fields, while retaining the default 
templating rules for the remainder of the content.
+
+.. code-block:: python
+
+    fixed_print_script = BashOperator(
+        task_id="fixed_print_script",
+        bash_command=LiteralValue("cat script.sh"),
+    )
+

Review Comment:
   It’d be a good idea to add a `.. versionadded` marker somewhere around here.
   
   Also, [`airflow.template.templater` is not a public 
module](https://airflow.apache.org/docs/apache-airflow/stable/public-airflow-interface.html),
 and I’m not sure if we want to open it up (all its other contents are 
private); we may want to move the class somewhere else.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to