Skip to content

Commit

Permalink
feat(dbt): repos mart model (#2645)
Browse files Browse the repository at this point in the history
* feat(dbt): int_repositories

* feat(dbt): repositories mart model
  • Loading branch information
ccerv1 authored Dec 15, 2024
1 parent 00ec066 commit 63ae50b
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
20 changes: 20 additions & 0 deletions warehouse/dbt/models/intermediate/directory/int_repositories.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
select
artifacts.project_id,
artifacts.artifact_source_id,
artifacts.artifact_source,
artifacts.artifact_namespace,
artifacts.artifact_name,
artifacts.artifact_url,
repos.is_fork,
repos.branch,
repos.star_count,
repos.watcher_count,
repos.fork_count,
repos.license_name,
repos.license_spdx_id,
repos.language,
repos.created_at,
repos.updated_at
from {{ ref('int_artifacts_in_ossd_by_project') }} as artifacts
inner join {{ ref('stg_ossd__current_repositories') }} as repos
on artifacts.artifact_source_id = CAST(repos.id as STRING)
27 changes: 27 additions & 0 deletions warehouse/dbt/models/marts/directory/repositories_v0.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{{
config(
materialized='table',
meta = {
'sync_to_db': True,
}
)
}}

select
project_id,
artifact_source_id,
artifact_source,
artifact_namespace,
artifact_name,
artifact_url,
is_fork,
branch,
star_count,
watcher_count,
fork_count,
license_name,
license_spdx_id,
`language`,
created_at,
updated_at
from {{ ref('int_repositories') }}

0 comments on commit 63ae50b

Please sign in to comment.