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/09/22 11:07:06 UTC

[GitHub] [airflow] mhenc commented on a diff in pull request #26509: Fix airflow tasks run --local when dags_folder differs from that of processor

mhenc commented on code in PR #26509:
URL: https://github.com/apache/airflow/pull/26509#discussion_r977517608


##########
airflow/models/dag.py:
##########
@@ -1189,11 +1195,25 @@ def relative_fileloc(self) -> pathlib.Path:
         """File location of the importable dag 'file' relative to the configured DAGs folder."""
         path = pathlib.Path(self.fileloc)
         try:
-            return path.relative_to(settings.DAGS_FOLDER)
+            rel_path = path.relative_to(self.dag_processor_dags_folder or settings.DAGS_FOLDER)
+            if rel_path == pathlib.Path('.'):
+                return path
+            else:
+                return rel_path
         except ValueError:
             # Not relative to DAGS_FOLDER.
             return path
 
+    @property
+    def dag_processor_dags_folder(self):

Review Comment:
   nit: How does it apply to `processor_subdir` field from e.g.DagModel? 
   Doesn't it have the same meaning?
   Maybe we should keep the name consistent?



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