jedcunningham commented on code in PR #41433:
URL: https://github.com/apache/airflow/pull/41433#discussion_r1734089081
##########
airflow/dag_processing/manager.py:
##########
@@ -526,6 +526,12 @@ def deactivate_stale_dags(
dags_parsed = session.execute(query)
for dag in dags_parsed:
+ # When the DAG processor runs as part of the scheduler, and the
user changes the DAG home folder,
+ # DAGs from the previous DAG home will be marked as stale. Note
that this change has no impact
+ # on standalone DAG processors.
+ if os.path.commonpath([dag.fileloc, dag_directory]) !=
dag_directory:
Review Comment:
Right, but you can mitigate it by doing something like this (no time spent
thinking of naming):
```
# explain different DAGs folder in a comment
dag_folder_different = ...
# explain timed out in a comment
dag_timed_out = ...
if dag_folder_different or dag_timed_out:
....
```
It's not perfect - you can't short circuit, so you always calculate both
conditions - but worth it for readability imo.
--
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]