-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: update dbt test should run in pre and prod depending on context (…
…et/somenergia-jardiner!33) * chore: lint test not passing before fixing it. Related to #76 * fix: missing dbt deps in task * change: avoid merging arrays in yaml * fix: extending arrays properly extending arrays in yaml is clunky, see yaml/yaml#35 * new: add dbt build instead of dbt test, parametrized by context during merge requests, use target pre on main, use target prod * new: make dbt run when there are changes in dbt models
- Loading branch information
1 parent
488f04c
commit 5c923ee
Showing
2 changed files
with
32 additions
and
17 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
@@ -1,15 +1,19 @@ | ||
-- tests pairs device_uuid, plant, device, device_type, device_parent as unique | ||
with tb as ( | ||
select distinct device_uuid, plant, device, device_type, device_parent | ||
from {{ ref('raw_gestio_actius__signal_denormalized') }} | ||
order by plant, device), | ||
with | ||
tb as ( | ||
select distinct device_uuid, plant, device, device_type, device_parent | ||
from {{ ref("raw_gestio_actius__signal_denormalized") }} | ||
order by plant, device | ||
), | ||
|
||
tb2 as ( | ||
select tb.device_uuid, count(*) as duplicates | ||
from tb | ||
group by device_uuid | ||
having count(*)> 1 | ||
select tb.device_uuid, count(*) as duplicates | ||
from tb | ||
group by tb.device_uuid | ||
having count(*) > 1 | ||
) | ||
select r.*, duplicates | ||
from {{ ref('raw_gestio_actius__signal_denormalized') }} r | ||
left join tb2 on tb2.device_uuid = r.device_uuid | ||
where duplicates is not null | ||
|
||
select r.*, tb2.duplicates | ||
from {{ ref("raw_gestio_actius__signal_denormalized") }} as r | ||
left join tb2 on r.device_uuid = tb2.device_uuid | ||
where tb2.duplicates is not null |