dstandish commented on code in PR #26509:
URL: https://github.com/apache/airflow/pull/26509#discussion_r977898457
##########
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:
from the looks of it, that's why e.g. you have a `--subdir` option in
airflow dags-processor command (which can be different from DAGS_FOLDER)
and then you have this logic
https://github.com/apache/airflow/blob/main/airflow/dag_processing/manager.py#L508-L509
this logic appears to say, "if i am a standalone dags processor, and i
didn't find the dags in my path, then mark them as stale"
it does seem a bit weird though because then maybe if you change the dags
processor subdirs later, perhaps some of those dags would never be returned by
this query and therefore would never be deactivated?
--
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]