Skip to content
This repository was archived by the owner on May 5, 2025. It is now read-only.

Commit 1ab5558

Browse files
committed
fix: ta_timeseries flake set and dict
when we get bytes out of the DB using django it returns them as a memoryview so if you want the actual values in bytes you must call the bytes constructor on the memoryview
1 parent 71420fd commit 1ab5558

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

services/test_analytics/ta_timeseries.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,17 @@
2121

2222

2323
def get_flaky_tests_set(repo_id: int) -> set[bytes]:
24-
return set(
25-
Flake.objects.filter(repoid=repo_id, end_date__isnull=True)
24+
return {
25+
bytes(test_id)
26+
for test_id in Flake.objects.filter(repoid=repo_id, end_date__isnull=True)
2627
.values_list("test_id", flat=True)
2728
.distinct()
28-
)
29+
}
2930

3031

3132
def get_flaky_tests_dict(repo_id: int) -> dict[bytes, FlakeInfo]:
3233
return {
33-
flake.test_id: FlakeInfo(flake.fail_count, flake.count)
34+
bytes(flake.test_id): FlakeInfo(flake.fail_count, flake.count)
3435
for flake in Flake.objects.filter(repoid=repo_id, end_date__isnull=True)
3536
}
3637

0 commit comments

Comments
 (0)