-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Andrew D.Gramigna
committed
Nov 8, 2023
1 parent
f7cf23c
commit fc2d8fb
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
levergreen_dbt/tests/confirm_active_jobs_per_company_scraped.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{# Nov 2023 | ||
Adds a test which confirms that the expected number of job postings from the source is being | ||
displayed properly in active job postings. Added because of script error when lever changed around | ||
their departments | ||
#} | ||
|
||
with unique_active_jobs_per_company as ( | ||
select run_hash, source, job_board, count(*) as num_openings | ||
from {{ ref('active_job_postings') }} | ||
group by 1,2,3 | ||
), | ||
|
||
sources as ( | ||
select run_hash, source, 'greenhouse' as job_board, count(*) as num_source_openings | ||
from {{ source('greenhouse', 'greenhouse_jobs_outline') }} | ||
where department_ids is not null --excludes a couple broken links from source (General Applications) | ||
group by 1,2,3 | ||
union all | ||
select run_hash, source, 'lever' as job_board, count(*) as num_source_openings | ||
from {{ source('lever', 'lever_jobs_outline') }} | ||
group by 1,2,3 | ||
union all | ||
select run_hash, ashby_job_board_source, 'ashby' as job_board, count(*) as num_source_openings | ||
from {{ source('ashby', 'ashby_jobs_outline') }} | ||
group by 1,2,3 | ||
) | ||
|
||
select * from unique_active_jobs_per_company as unique_active_jobs | ||
inner join sources on unique_active_jobs.run_hash = sources.run_hash | ||
and unique_active_jobs.source = sources.source | ||
where num_openings != num_source_openings |