Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions services/libs/tinybird/pipes/active_contributors.pipe
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ SQL >
NODE maintainers_count
SQL >
%
SELECT uniq(memberId) AS maintainerCount
SELECT uniqIf(memberId, memberId != '') AS maintainerCount
FROM maintainers_roles_copy_ds
WHERE
insightsProjectId = (SELECT insightsProjectId FROM segments_filtered)
insightsProjectId = (SELECT insightsProjectId FROM segments_filtered) AND role = 'maintainer'
{% if defined(repos) %}
AND repoUrl
IN {{ Array(repos, 'String', description="Filter maintainer repo list", required=False) }}
Expand All @@ -73,7 +73,8 @@ SQL >
OR endDate
>= {% if defined(startDate) %}
{{ DateTime(startDate, description="Filter maintainer start date", required=False) }}
{% else %} toDateTime64('1970-01-01 00:00:00', 3)
{% elif defined(endDate) %} toDateTime64('1970-01-01 00:00:00', 3)
{% else %} now()
Comment thread
cursor[bot] marked this conversation as resolved.
Comment thread
joanagmaia marked this conversation as resolved.
Comment thread
joanagmaia marked this conversation as resolved.
{% end %}
Comment thread
joanagmaia marked this conversation as resolved.
)

Expand Down
12 changes: 11 additions & 1 deletion services/libs/tinybird/pipes/maintainers_roles_copy.pipe
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,17 @@ SQL >

NODE maintainers_roles_copy_member_identities_deduplicated
SQL >
SELECT id, memberId FROM memberIdentities FINAL WHERE isNull (deletedAt)
SELECT id, memberId
FROM
(
SELECT
id,
argMax((mi.memberId, mi.deletedAt), mi.updatedAt) .1 AS memberId,
argMax((mi.memberId, mi.deletedAt), mi.updatedAt) .2 AS deletedAt
Comment thread
joanagmaia marked this conversation as resolved.
FROM memberIdentities as mi
GROUP BY id
) AS deduped
WHERE isNull (deduped.deletedAt)

NODE maintainers_roles_copy_maintainers_deduplicated
SQL >
Expand Down
Loading