Skip to content

Commit

Permalink
fix: filter intermediate dependency events by artifacts_v1 (#2526)
Browse files Browse the repository at this point in the history
* fix: filter intermediate dependency events by `artifacts_v1`

* fix: remove `cyclic` dependency
  • Loading branch information
Jabolol authored Nov 26, 2024
1 parent 22a47b2 commit 0a812c8
Showing 1 changed file with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,21 @@ with snapshots as (
where `MinimumDepth` = 1
),

artifacts as (
select artifact_name
from {{ ref('int_all_artifacts') }}
where artifact_source = "NPM"
),

intermediate as (
select
`time`,
case
when previous_to_artifact_name is null then 'ADD_DEPENDENCY'
when previous_to_artifact_name is null then "ADD_DEPENDENCY"
when
to_artifact_name is not null and to_artifact_name <> previous_to_artifact_name
then 'REMOVE_DEPENDENCY'
else 'NO_CHANGE'
then "REMOVE_DEPENDENCY"
else "NO_CHANGE"
end as event_type,
{{ event_source_name }} as event_source,
{{ parse_name(
Expand All @@ -48,6 +54,7 @@ intermediate as (
from_artifact_type,
1.0 as amount
from snapshots
where from_artifact_name in (select artifact_name from artifacts)
),

artifact_ids as (
Expand Down Expand Up @@ -81,7 +88,7 @@ artifact_ids as (
}} as from_artifact_source_id,
amount
from intermediate
where event_type <> 'NO_CHANGE'
where event_type <> "NO_CHANGE"
),

changes as (
Expand Down

0 comments on commit 0a812c8

Please sign in to comment.