From d198849e734b8530bfbdbbc2d4226bbe731d3a25 Mon Sep 17 00:00:00 2001 From: Carl Cervone <42869436+ccerv1@users.noreply.github.com> Date: Wed, 29 May 2024 17:14:57 -0400 Subject: [PATCH] refactor int_artifacts_by_project (#1558) --- .../directory/int_artifacts_by_project.sql | 22 ++++++++++++------- .../directory/artifacts_by_project_v1.sql | 22 +++++++++---------- 2 files changed, 24 insertions(+), 20 deletions(-) diff --git a/warehouse/dbt/models/intermediate/directory/int_artifacts_by_project.sql b/warehouse/dbt/models/intermediate/directory/int_artifacts_by_project.sql index e76433c40..58fe9d861 100644 --- a/warehouse/dbt/models/intermediate/directory/int_artifacts_by_project.sql +++ b/warehouse/dbt/models/intermediate/directory/int_artifacts_by_project.sql @@ -1,9 +1,15 @@ select distinct - project_id, - artifact_id, - artifact_source_id, - artifact_source, - artifact_namespace, - artifact_name, - artifact_url -from {{ ref('int_all_artifacts') }} + artifacts.artifact_id, + artifacts.artifact_source_id, + artifacts.artifact_source, + artifacts.artifact_namespace, + artifacts.artifact_name, + artifacts.artifact_url, + artifacts.project_id, + projects.project_source, + projects.project_namespace, + projects.project_name +from {{ ref('int_all_artifacts') }} as artifacts +left join {{ ref('int_projects') }} as projects + on artifacts.project_id = projects.project_id +where artifacts.project_id is not null diff --git a/warehouse/dbt/models/marts/directory/artifacts_by_project_v1.sql b/warehouse/dbt/models/marts/directory/artifacts_by_project_v1.sql index a3576c8a5..3388e797f 100644 --- a/warehouse/dbt/models/marts/directory/artifacts_by_project_v1.sql +++ b/warehouse/dbt/models/marts/directory/artifacts_by_project_v1.sql @@ -5,15 +5,13 @@ }} select - artifacts_by_project.artifact_id, - artifacts_by_project.artifact_source_id, - artifacts_by_project.artifact_source, - artifacts_by_project.artifact_namespace, - artifacts_by_project.artifact_name, - projects.project_id, - projects.project_source, - projects.project_namespace, - projects.project_name -from {{ ref('int_artifacts_by_project') }} as artifacts_by_project -left join {{ ref('int_projects') }} as projects - on artifacts_by_project.project_id = projects.project_id + artifact_id, + artifact_source_id, + artifact_source, + artifact_namespace, + artifact_name, + project_id, + project_source, + project_namespace, + project_name +from {{ ref('int_artifacts_by_project') }}