This is an automated email from the ASF dual-hosted git repository.
jedcunningham pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new 67313bbc844 Remove hash on GitDagBundle (#44666)
67313bbc844 is described below
commit 67313bbc844454bd56482fef88896eb75b242d1a
Author: Daniel Standish <[email protected]>
AuthorDate: Wed Dec 4 19:26:37 2024 -0800
Remove hash on GitDagBundle (#44666)
It's a bit sketchy to to make this hashable, I think. The idea of what is
the identity of a dag bundle is not very well defined. In the orm sense, it's
just the name. But in another context it might mean name + version. So, we
should just leave it to the call site to be explicit about it. Meanwhile, I
add a better repr.
---
airflow/dag_processing/bundles/git.py | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/airflow/dag_processing/bundles/git.py
b/airflow/dag_processing/bundles/git.py
index 2022e613086..6547bc8ecad 100644
--- a/airflow/dag_processing/bundles/git.py
+++ b/airflow/dag_processing/bundles/git.py
@@ -93,8 +93,15 @@ class GitDagBundle(BaseDagBundle):
if not self._has_version(self.bare_repo, self.version):
raise AirflowException(f"Version {self.version} not found in
the repository")
- def __hash__(self) -> int:
- return hash((self.name, self.get_current_version()))
+ def __repr__(self):
+ return (
+ f"<GitDagBundle("
+ f"name={self.name!r}, "
+ f"tracking_ref={self.tracking_ref!r}, "
+ f"subdir={self.subdir!r}, "
+ f"version={self.version!r}"
+ f")>"
+ )
def get_current_version(self) -> str:
return self.repo.head.commit.hexsha