Skip to content

Commit

Permalink
fix: singer slack message duplicate join part 2 (#667)
Browse files Browse the repository at this point in the history
  • Loading branch information
pnadolny13 authored Jul 20, 2023
1 parent e46be85 commit 02c5443
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion data/transform/macros/slack_message_generator.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{% macro slack_message_generator() -%}
'\n • <' || html_url || ' | ' || organization_name || '/' || repo_name || ' #' || GET(split(html_url, '/'), array_size(split(html_url, '/'))-1)::STRING || '> (*' || author_username || '*) - _' || title || '_' || CASE WHEN singer_contributions.is_hub_listed THEN ' (:melty-flame: < ' || stg_meltanohub__plugins.docs || ' | _MeltanoHub Link_>)\n' ELSE '\n' END
'\n • <' || html_url || ' | ' || organization_name || '/' || repo_name || ' #' || GET(split(html_url, '/'), array_size(split(html_url, '/'))-1)::STRING || '> (*' || author_username || '*) - _' || title || '_' || CASE WHEN singer_contributions.is_hub_listed THEN ' (:melty-flame: < ' || hub_unique.docs || ' | _MeltanoHub Link_>)\n' ELSE '\n' END
{%- endmacro %}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ WITH most_recent_date AS (

),

hub_unique AS (
SELECT
repo,
MAX(docs) AS docs
FROM {{ ref('stg_meltanohub__plugins') }}
GROUP BY 1
),

base AS (
SELECT
ARRAY_AGG(
Expand Down Expand Up @@ -78,11 +86,11 @@ base AS (
) AS issues_closed
FROM {{ ref('singer_contributions') }}
CROSS JOIN most_recent_date
LEFT JOIN {{ ref('stg_meltanohub__plugins') }}
LEFT JOIN hub_unique
ON
LOWER(
singer_contributions.repo_url
) = LOWER(stg_meltanohub__plugins.repo)
) = LOWER(hub_unique.repo)
WHERE singer_contributions.is_bot_user = FALSE
),

Expand Down

0 comments on commit 02c5443

Please sign in to comment.