Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: singer slack message duplicate join part 2 #667

Merged
merged 1 commit into from
Jul 20, 2023
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
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