Skip to content

Commit

Permalink
fix: add metric to dm_metrics_production_5min (et/somenergia-jardiner…
Browse files Browse the repository at this point in the history
…!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
polmonso committed Dec 14, 2023
1 parent 36aef25 commit 93df4e3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions dbt_jardiner/models/jardiner/marts/dm_metrics_production_5min.sql
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

0 comments on commit 93df4e3

Please sign in to comment.