potiuk commented on code in PR #41086:
URL: https://github.com/apache/airflow/pull/41086#discussion_r1696262540


##########
airflow/models/baseoperator.py:
##########
@@ -517,7 +517,11 @@ def __new__(cls, name, bases, namespace, **kwargs):
             partial_desc = vars(new_cls)["partial"]
             if isinstance(partial_desc, _PartialDescriptor):
                 partial_desc.class_method = classmethod(partial)
-        new_cls.__init__ = cls._apply_defaults(new_cls.__init__)
+
+        # We patch `__init__` only if the class defines it.
+        if inspect.getmro(new_cls)[1].__init__ is not new_cls.__init__:

Review Comment:
   Should not we walk up the MRO hierarchy and patch the __init__ of the actual 
base operator here?  I think that one will loose apply_defaults being applied 
at all - unless I am mistaken?



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to