uranusjr commented on pull request #16956:
URL: https://github.com/apache/airflow/pull/16956#issuecomment-880380845


   This can be seen with `BashOperator`’s `bash_command` argument. If you 
search [this documentation 
page](https://airflow.apache.org/docs/apache-airflow/stable/howto/operator/bash.html),
 the argument is used both to pass a command directly, and a path to a `.sh` 
file. The mechanism is done by checking `template_fields` and `template_ext`; 
if a field is listed in `template_fields`, *and the value ends with one of the 
value in `template_ext`, the value will be treated as a path and the target 
file read as a Jinja2 template to render the actual field value at runtime. The 
logic is implemented here:
   
   
https://github.com/apache/airflow/blob/fc0250f1d5c43784f353dbdf4a34089aa96c28e5/airflow/models/baseoperator.py#L1047-L1054
   
   `SparkKubernetesOperator` has
   
   
https://github.com/apache/airflow/blob/fc0250f1d5c43784f353dbdf4a34089aa96c28e5/airflow/providers/cncf/kubernetes/operators/spark_kubernetes.py#L45-L47
   
   So `application_file` will be templated if the file extension is `.json`, 
`.yaml`, or `.yml`.


-- 
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