-
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.
fix: add metric to dm_metrics_production_5min (et/somenergia-jardiner…
…!57) * use the bad name device_parent instead of device_parent_name so we don't have that much impact on the pipe * fix: add parent device name to dm_metrics_production_5min * fix: add metric_name to dm_metrics_production_5min
- Loading branch information
Showing
2 changed files
with
9 additions
and
10 deletions.
There are no files selected for viewing
File renamed without changes.
19 changes: 9 additions & 10 deletions
19
dbt_jardiner/models/jardiner/marts/dm_metrics_production_5min.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 |
---|---|---|
@@ -1,19 +1,18 @@ | ||
{{ config(materialized='view') }} | ||
|
||
{# TODO left join with expected signals (we need those nulls!) #} | ||
|
||
{{ config(materialized="view") }} | ||
|
||
select | ||
ts, | ||
signal_value as valor, | ||
plant_name as nom_planta, | ||
device_uuid as uuid_aparell, | ||
device_name as aparell, | ||
device_type as tipus_aparell, | ||
signal_name as senyal, | ||
signal_unit as unitat_senyal, | ||
signal_value as valor | ||
from {{ ref("int_dset_responses__spined_metadata") }} | ||
where device_type in ('inverter','sensor', 'string') | ||
and ts > (now() at time zone 'Europe/Madrid')::date - interval '30 days' | ||
metric_name as nom_metrica, | ||
signal_name as senyal, | ||
device_parent as nom_aparell_pare | ||
from {{ ref("int_dset_responses__spined_metadata") }} as dset_with_meta | ||
where | ||
device_type in ('inverter', 'sensor', 'string') | ||
and ts > (now() at time zone 'Europe/Madrid')::date - interval '30 days' | ||
order by ts desc, plant_name | ||
|