Skip to content

Commit 448bbe3

Browse files
authored
feat: leaderboard fixes (IN-813) (#3576)
Signed-off-by: Gašper Grom <gasper.grom@gmail.com>
1 parent 6ae100e commit 448bbe3

File tree

4 files changed

+5
-40
lines changed

4 files changed

+5
-40
lines changed

services/libs/tinybird/pipes/leaderboards_commits.pipe

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ DESCRIPTION >
1717
Counts total git commits for each project in the last 12 months
1818

1919
SQL >
20-
SELECT segmentId, count(activityId) as commits
20+
SELECT segmentId, count() as commits
2121
FROM activityRelations_deduplicated_cleaned_ds
2222
WHERE
2323
timestamp >= now() - INTERVAL 12 MONTH
2424
AND timestamp < now()
2525
AND activityId != ''
26-
AND (type = 'authored-commit' OR type = 'committed-commit')
26+
AND type = 'authored-commit'
2727
AND platform = 'git'
2828
GROUP BY segmentId
2929

@@ -38,7 +38,7 @@ SQL >
3838
timestamp >= now() - INTERVAL 24 MONTH
3939
AND timestamp < now() - INTERVAL 12 MONTH
4040
AND activityId != ''
41-
AND (type = 'authored-commit' OR type = 'committed-commit')
41+
AND type = 'authored-commit'
4242
AND platform = 'git'
4343
GROUP BY segmentId
4444

services/libs/tinybird/pipes/leaderboards_copy.pipe

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ DESCRIPTION >
88
Unions all leaderboard results with their respective type identifiers for consolidated querying
99

1010
SQL >
11-
SELECT *, 0.0 as previousPeriodValue, 'longest-running' as leaderboardType
12-
FROM leaderboards_project_first_commit
13-
UNION ALL
1411
SELECT *, 'active-contributors' as leaderboardType
1512
FROM leaderboards_project_active_contributors
1613
UNION ALL

services/libs/tinybird/pipes/leaderboards_project_first_commit.pipe

Lines changed: 0 additions & 29 deletions
This file was deleted.

services/libs/tinybird/pipes/leaderboards_small_project_commit.pipe

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,9 @@ DESCRIPTION >
1818
Counts total git commits for each project
1919

2020
SQL >
21-
SELECT segmentId, count(activityId) as commits
21+
SELECT segmentId, count() as commits
2222
FROM activityRelations_deduplicated_cleaned_ds
23-
WHERE
24-
activityId != ''
25-
AND (type = 'authored-commit' OR type = 'committed-commit')
26-
AND platform = 'git'
23+
WHERE activityId != '' AND type = 'authored-commit' AND platform = 'git'
2724
GROUP BY segmentId
2825

2926
NODE leaderboards_small_project_commit_results

0 commit comments

Comments
 (0)