airflow-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Maxime Beauchemin <maximebeauche...@gmail.com>
Subject Re: Limitations of templating
Date Wed, 21 Jun 2017 00:00:21 GMT
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 <niranda.17@cse.mrt.ac.lk>
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
> niranda.17@cse.mrt.ac.lk
> +94 71 554 8430
> https://lk.linkedin.com/in/niranda
>
> On Tue, Jun 20, 2017 at 3:03 PM, Shah Altaf <mendhak@gmail.com> 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 <niranda.17@cse.mrt.ac.lk
> >
> > 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
> > > niranda.17@cse.mrt.ac.lk
> > > +94 71 554 8430 <+94%2071%20554%208430>
> > > https://lk.linkedin.com/in/niranda
> > >
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message