I can't seem to get this to work.
I am trying to send daily a given file, whose name is like 'file_{{ds_nodash}}.csv'.
The problem is that I can't seem to add this name as the filename, since it seems it cant be used. In the text of the email or the subject works perfectly, not not on the name.
Here is the dag as an example:
local_file = 'file-{{ds_nodash}}.csv'
send_stats_csv = EmailOperator(
task_id='send-stats-csv',
to=['email@gmail.com'],
subject='Subject - {{ ds }}',
html_content='Here is the new file.',
files=[local_file],
dag=dag)
Error code: No such file or directory: u'file-{{ds_nodash}}.csv'
If i write it literally, with its given date, it works flawlessly.
Where am I wrong? How should I go about this?
Any help would be appreciated.
Thanks.
P.D. Copy paste from airflow's documentation - "The Airflow engine passes a few variables by default that are accessible in all templates". https://airflow.incubator.apache.org/code.html
If I understood correctly, these variables are accessible in execution, so if i am executing the dag, the file should be found right? I've tried both testing the task or backfilling the dag with no success.