You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/08/01 07:50:16 UTC

[GitHub] [airflow] cansjt commented on issue #25431: Operator deepcopy does not honor `shallow_copy_attrs` if value also referenced in `__init_kwargs`

cansjt commented on issue #25431:
URL: https://github.com/apache/airflow/issues/25431#issuecomment-1200842185

   Greping through the code on the `main` branch, I cannot find any place where the `__init_kwargs` attribute is actually ever read. It is set in different places, but not read:
   ```
   $ git grep _init_kwargs
   airflow/models/baseoperator.py:406:            if not hasattr(self, '_BaseOperator__init_kwargs'):
   airflow/models/baseoperator.py:407:                self._BaseOperator__init_kwargs = {}
   airflow/models/baseoperator.py:413:            self._BaseOperator__init_kwargs.update(kwargs)  # type: ignore
   airflow/models/baseoperator.py:680:    __init_kwargs: Dict[str, Any]
   airflow/models/baseoperator.py:755:        self.__init_kwargs = {}
   airflow/models/baseoperator.py:1007:        if key in self.__init_kwargs:
   airflow/models/baseoperator.py:1008:            self.__init_kwargs[key] = value
   airflow/models/baseoperator.py:1168:        result.__init_kwargs = init_kwargs = {}
   airflow/models/baseoperator.py:1170:            if k in ("_BaseOperator__instantiated", "_BaseOperator__init_kwargs"):
   airflow/models/baseoperator.py:1178:        for k, v in self.__dict__["_BaseOperator__init_kwargs"]:
   airflow/models/baseoperator.py:1466:                    '_BaseOperator__init_kwargs',
   ```
   What am I missing?


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org