dimberman opened a new issue #7910: Allow jinja templates to be used in task 
params
URL: https://github.com/apache/airflow/issues/7910
 
 
   **Description**
   
   
   
   At present when defining an Operator it isn't possible to reference template 
variables such as ds in the params block.
   
   Enabling this makes it easier to reuse Operators with very similar 
configurations. An example of this might be a BashOperator which runs a large 
(possibly external) script that only has a couple of configuration changes used 
between different runs.
   
   
   **Use case / motivation**
   For example, you might have something like this:
   
   ```python
   op = BashOperator(
        task_id = "task",
        bash_command = "do-something.sh {{params.path}}",
           params = {"path": "/path/to/thing/{{ds}}/thing.csv"},
           dag = dag
   )
   ```
   In this case, the bash_command will be expanded to:
   ```
     do-something.sh /path/to/thing/{{ds}}/things.csv
   ```
   But should be expanded to:
   ```
     do-something.sh /path/to/thing/2017-06-14/things.csv
   ```
   
   **Related Issues**
   
   <!-- Is there currently another issue associated with this? -->
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to