ephraimbuddy commented on code in PR #66484:
URL: https://github.com/apache/airflow/pull/66484#discussion_r3196558184
##########
airflow-core/src/airflow/dag_processing/manager.py:
##########
@@ -1012,22 +1012,31 @@ def handle_removed_files(self, known_files: dict[str,
set[DagFileInfo]]):
self.terminate_orphan_processes(present=files_set)
self.remove_orphaned_file_stats(present=files_set)
+ @staticmethod
+ def _present_file_key(file: DagFileInfo) -> tuple[str, Path]:
Review Comment:
Consider moving this onto `DagFileInfo` itself as a `presence_key` property:
```python
@dataclass(frozen=True)
class DagFileInfo:
...
@property
def presence_key(self) -> tuple[str, Path]:
return self.bundle_name, self.rel_path
```
The dual-identity model is a property of the type, not of the manager. Lets
call sites read `x.presence_key in present_keys`, and the same property could
be used at line 1267 to fix the related issue I called out in the summary.
--
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]