We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 68b6d21 commit 74a0fe1Copy full SHA for 74a0fe1
src/writegithubstat/githubstat.py
@@ -162,12 +162,12 @@ def _get_actual_stat(
162
self, data: Dict[str, Any], name: str
163
) -> Dict[str, Union[int, str]]:
164
try:
165
- stat = data[name][-1]
166
- if not stat["timestamp"].startswith(self._date):
167
- raise ValueError(
168
- f"The views data for the date {self._date} is not available."
169
- )
170
- return stat
+ for stat in data[name]:
+ if stat["timestamp"].startswith(self._date):
+ return stat
+ raise ValueError(
+ f"The views data for the date {self._date} is not available."
+ )
171
except (KeyError, IndexError, ValueError):
172
return {"count": 0, "uniques": 0}
173
0 commit comments