jedcunningham commented on code in PR #46029:
URL: https://github.com/apache/airflow/pull/46029#discussion_r1932734787
##########
airflow/dag_processing/manager.py:
##########
@@ -238,36 +239,40 @@ def _scan_stale_dags(self):
last_parsed = {
fp: stat.last_finish_time for fp, stat in
self._file_stats.items() if stat.last_finish_time
}
- self.deactivate_stale_dags(
- last_parsed=last_parsed,
- stale_dag_threshold=self.stale_dag_threshold,
- )
+ self.deactivate_stale_dags(last_parsed=last_parsed)
self._last_deactivate_stale_dags_time = time.monotonic()
@provide_session
def deactivate_stale_dags(
self,
last_parsed: dict[DagFileInfo, datetime | None],
- stale_dag_threshold: int,
session: Session = NEW_SESSION,
):
"""Detect and deactivate DAGs which are no longer present in files."""
to_deactivate = set()
query = select(
- DagModel.dag_id, DagModel.bundle_name, DagModel.fileloc,
DagModel.last_parsed_time
+ DagModel.dag_id,
+ DagModel.bundle_name,
+ DagModel.fileloc,
+ DagModel.last_parsed_time,
+ DagModel.relative_fileloc,
).where(DagModel.is_active)
# TODO: AIP-66 by bundle!
dags_parsed = session.execute(query)
+ from pathlib import Path
Review Comment:
this is already imported.
```suggestion
```
--
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]