Shah and Maxime, Thank you very much for the explanations. I went through the code in a little detail and now I understand how fields and files templates are getting resolved by the template_fields and template_ext in the BaseOperator API.
Best regards Niranda Perera Research Assistant Dept of CSE, University of Moratuwa [email protected] +94 71 554 8430 https://lk.linkedin.com/in/niranda On Wed, Jun 21, 2017 at 5:30 AM, Maxime Beauchemin < [email protected]> wrote: > All operators' `execute` method receive a `context` dict, that is > essentially the same as what you find in the main Jinja namespace. > > `provide_context` is specific to `PythonOperator` and its derivatives and > defines whether you want the operator to unpack that context dict into your > callable as kwargs. > > Max > > On Tue, Jun 20, 2017 at 4:54 PM, Niranda Perera <[email protected]> > wrote: > > > Thanks Shah for the heads up! > > > > Coming to think of it, why can't 'provide_context' be a argument in the > > BaseOperator? wouldn't this allow all the operators to make use of the > > variables? > > > > Best regards > > > > Niranda Perera > > Research Assistant > > Dept of CSE, University of Moratuwa > > [email protected] > > +94 71 554 8430 > > https://lk.linkedin.com/in/niranda > > > > On Tue, Jun 20, 2017 at 3:03 PM, Shah Altaf <[email protected]> wrote: > > > > > Hi Niranda - the best way I find is to have a quick peek at the source > > > code. Just as an example the MsSql operator, go to the source code > > > > > > https://pythonhosted.org/airflow/_modules/mssql_operator.html > > > > > > And look for template_fields. Anything you see in the template_fields > > will > > > allow for templating. > > > > > > > > > On Tue, Jun 20, 2017 at 9:33 AM Niranda Perera < > [email protected] > > > > > > wrote: > > > > > > > Hi, > > > > > > > > I was going through the jinja templating in airflow and in the > generic > > > > operators, it seemed like, it is limited to the bash and python > > > operators? > > > > > > > > I would like to get a clarification on this? > > > > > > > > Best regards > > > > > > > > Niranda Perera > > > > Research Assistant > > > > Dept of CSE, University of Moratuwa > > > > [email protected] > > > > +94 71 554 8430 <+94%2071%20554%208430> > > > > https://lk.linkedin.com/in/niranda > > > > > > > > > >
