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

Commit b2ff349

Browse files
committed
fix: add comment and use after
1 parent 6b91d86 commit b2ff349

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

graphql_api/types/test_analytics/test_analytics.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,13 +218,15 @@ def generate_test_results(
218218
case TestResultsFilterParameter.SLOWEST_TESTS:
219219
table = table.filter(
220220
pl.col("avg_duration") >= pl.col("avg_duration").quantile(0.95)
221-
).top_k(min(100, max(table.height // 20, 1)), by=pl.col("avg_duration"))
221+
).top_k(
222+
min(100, max(table.height // 20, 1)), by=pl.col("avg_duration")
223+
) # the top k operation here is to make sure we don't show too many slowest tests in the case of a low sample size
222224

223225
total_count = table.height
224226

225227
if after or before:
226228
comparison_direction = (ordering_direction == OrderingDirection.ASC) == (
227-
bool(first)
229+
bool(after)
228230
)
229231
cursor_value = (
230232
decode_cursor(after, ordering) if after else decode_cursor(before, ordering)

0 commit comments

Comments
 (0)