Skip to content

Commit 2458074

Browse files
joanagmaiaclaude
andcommitted
fix: filter critical projects KPI to code contribution activity types only IN-1204
Aligns org_page_kpis_critical_projects with org_page_projects_copy_pipe which already filters to isCodeContribution. KPI and list now use the same population. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Joana Maia <jmaia@contractor.linuxfoundation.org>
1 parent 03f8439 commit 2458074

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

services/libs/tinybird/pipes/org_page_kpis_copy_pipe.pipe

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,17 +60,19 @@ SQL >
6060

6161
NODE org_page_kpis_critical_projects
6262
DESCRIPTION >
63-
Count of distinct projects (segmentIds) an org contributed to in the last 730 days (2 years).
63+
Count of distinct projects (segmentIds) an org made code contributions to in the last 730 days (2 years).
6464
Serves as the "critical projects" placeholder until a real criticality filter is added.
6565

6666
SQL >
67-
SELECT organizationId, uniq(segmentId) AS criticalProjects
68-
FROM activityRelations_deduplicated_cleaned_bucket_union
67+
SELECT ar.organizationId, uniq(ar.segmentId) AS criticalProjects
68+
FROM activityRelations_deduplicated_cleaned_bucket_union ar
69+
INNER JOIN
70+
org_page_kpis_code_activity_types at ON ar.type = at.activityType AND ar.platform = at.platform
6971
WHERE
70-
organizationId != ''
71-
AND timestamp >= toStartOfDay(now() - toIntervalDay(730))
72-
AND timestamp < toStartOfDay(now() + toIntervalDay(1))
73-
GROUP BY organizationId
72+
ar.organizationId != ''
73+
AND ar.timestamp >= toStartOfDay(now() - toIntervalDay(730))
74+
AND ar.timestamp < toStartOfDay(now() + toIntervalDay(1))
75+
GROUP BY ar.organizationId
7476

7577
NODE org_page_kpis_final
7678
DESCRIPTION >

0 commit comments

Comments
 (0)