You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by ka...@apache.org on 2020/06/30 19:17:53 UTC

[airflow] 02/03: Access function to be pickled as attribute, not method, to avoid error. (#8823)

This is an automated email from the ASF dual-hosted git repository.

kaxilnaik pushed a commit to branch v1-10-test
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit e94ddc501794e6b7df9dc38d260328a53320c30d
Author: James Timmins <ja...@astronomer.io>
AuthorDate: Tue May 12 00:55:39 2020 -0700

    Access function to be pickled as attribute, not method, to avoid error. (#8823)
    
    * Access function to be pickled as attribute, not method, to avoid error.
    
    * Access type attribute to allow pickling.
    
    * Use getattr instead of type(self) to fix linting error.
    
    (cherry picked from commit 7533378df99a172ad681960243452a84280aa8b2)
---
 airflow/utils/dag_processing.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/airflow/utils/dag_processing.py b/airflow/utils/dag_processing.py
index d13b192..3a390e7 100644
--- a/airflow/utils/dag_processing.py
+++ b/airflow/utils/dag_processing.py
@@ -547,7 +547,8 @@ class DagFileProcessorAgent(LoggingMixin, MultiprocessingStartMethodMixin):
                 self._dag_directory,
                 self._file_paths,
                 self._max_runs,
-                self._processor_factory,
+                # getattr prevents error while pickling an instance method.
+                getattr(self, "_processor_factory"),
                 self._processor_timeout,
                 child_signal_conn,
                 self._dag_ids,