I saw that PR today and it made me realize I've not been using apply_defaults in much of my code!
Look forward to this being an automaic operation via a MetaClass, great work :) ! In general I wish Airflow would more heavily leverage MetaClasses and __init_subclass__ for stuff like this, having to pollute the global namespace with DAG objects still irks me. Damian -----Original Message----- From: Kamil Breguła <[email protected]> Sent: Wednesday, February 19, 2020 13:34 To: [email protected] Subject: Re: How is DAG's default_arg parameter forwarded to operators ? Hello, You may also be interested in this PR: https://github.com/apache/airflow/pull/7450 Best regards, Kamil On Wed, Feb 19, 2020 at 4:57 PM Shaw, Damian P. <[email protected]> wrote: > > I'm not an expert of the Airflow code, but in 1.10.2 I notice the decorator > on the __init__ of the BaseOperator named "apply_defaults": > https://github.com/apache/airflow/blob/1.10.2/airflow/models.py#L2472 > > Which is located here: > https://github.com/apache/airflow/blob/1.10.2/airflow/utils/decorators > .py#L37 > > Which has the docstring: > Function decorator that Looks for an argument named "default_args", and > fills the unspecified arguments from it. > > Damian > > > -----Original Message----- > From: Massy Bourennani <[email protected]> > Sent: Wednesday, February 19, 2020 10:49 > To: [email protected] > Subject: How is DAG's default_arg parameter forwarded to operators ? > > Hello all, > > I'm searching through the Git repo but I couldn't find the code responsible > for forwardings DAG's default_args to DAG's operators. > I'm using Airflow 1.10.2 > > Many thanks, > Massy > > > > ====================================================================== > ========= Please access the attached hyperlink for an important > electronic communications disclaimer: > http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html > ====================================================================== > ========= =============================================================================== Please access the attached hyperlink for an important electronic communications disclaimer: http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html ===============================================================================
