Skip to content

Commit dc202fb

Browse files
authored
Replace lazyproperty with cached_property (#6996)
1 parent bc1846f commit dc202fb

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

aws/lambda/pytorch-auto-revert/pytorch_auto_revert/autorevert_checker.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,9 @@
77
import re
88
from dataclasses import dataclass
99
from datetime import datetime, timedelta
10+
from functools import cached_property
1011
from typing import Dict, Iterable, List, Optional, Set, Tuple
1112

12-
from lazyproperty import lazyproperty
13-
1413
from .clickhouse_client_helper import CHCliFactory
1514

1615

@@ -92,23 +91,23 @@ def get_workflow_commits(self, workflow_name: str) -> List[CommitJobs]:
9291
self._fetch_workflow_data()
9392
return self._workflow_commits_cache.get(workflow_name, [])
9493

95-
@lazyproperty()
94+
@cached_property
9695
def workflow_commits(self) -> List[CommitJobs]:
9796
"""Get workflow commits for the first workflow (backward compatibility)."""
9897
if self.workflow_names:
9998
return self.get_workflow_commits(self.workflow_names[0])
10099
return []
101100

102-
@lazyproperty()
101+
@cached_property
103102
def commit_history(self) -> List[Dict]:
104103
"""Get commit history, fetching if needed."""
105104
return self._fetch_commit_history()
106105

107-
@lazyproperty()
106+
@cached_property
108107
def commits_reverted(self) -> Set[str]:
109108
return self._get_commits_reverted()
110109

111-
@lazyproperty()
110+
@cached_property
112111
def commits_reverted_with_info(self) -> Dict[str, Dict]:
113112
return self._get_commits_reverted_with_info()
114113

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
clickhouse-connect==0.8.14
2-
lazyproperty @ git+https://github.com/jeanschmidt/python_propertyutils@6a9083af8582e85c2bb30be85d22d8e0a88208c0
32
PyGithub==2.6.1
43
python-dotenv>=1.0.0
54
requests>=2.31.0

0 commit comments

Comments
 (0)