Skip to content

Commit

Permalink
trim raw_GA__signal_denormalized text fields (et/somenergia-jardiner!…
Browse files Browse the repository at this point in the history
…121)

Merge branch 'fix/trim_device_name' into 'main'
  • Loading branch information
polmonso committed Feb 22, 2024
2 parents 83f1d05 + 90b250f commit dba1c4f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion dbt_jardiner/models/jardiner/marts/_marts__models.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ models:
description: >
Darrera lectura d'irradiació i potència de cada planta i la producció del dia anterior segons comptadors
- name: dm_dashboard_overview__produccio_carter
- name: dm_dashboard_overview__produccio_cartera
description: >
Producció de totes les plantes per tecnologia del dia actual espinat per les 24h d'avui per a que
el superset dibuixi el dia sencer
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
{{ config(materialized="view") }}

with
fresh as (
select *
from {{ ref("snapshot_signal_denormalized") }}
where dbt_valid_to is null
),
fresh as (
select *
from {{ ref("snapshot_signal_denormalized") }}
where dbt_valid_to is null
),

base as (
select
plant_uuid::uuid,
plant::text as plant_name,
signal::text as signal_name,
metric::text as metric_name,
device::text as device_name,
device_type::text,
device_uuid::uuid,
device_parent::text,
signal_uuid::uuid,
inserted_at::timestamptz,
updated_at::timestamptz
from fresh
)
base as (
select
plant_uuid::uuid,
trim(plant::text) as plant_name,
trim(signal::text) as signal_name,
metric::text as metric_name,
trim(device::text) as device_name,
device_type::text,
device_uuid::uuid,
trim(device_parent::text) as device_parent,
signal_uuid::uuid,
inserted_at::timestamptz,
updated_at::timestamptz
from fresh
)

select * from base

0 comments on commit dba1c4f

Please sign in to comment.