From 9896042306a62b22cd6421b9fa4d5f48fc38b4c8 Mon Sep 17 00:00:00 2001 From: Gabriel Pisa <61624649+folhesgabriel@users.noreply.github.com> Date: Fri, 22 Sep 2023 08:37:13 -0300 Subject: [PATCH] Delete models/br_fgv_igp/br_fgv_igp__igp_di_mes.sql --- models/br_fgv_igp/br_fgv_igp__igp_di_mes.sql | 35 -------------------- 1 file changed, 35 deletions(-) delete mode 100644 models/br_fgv_igp/br_fgv_igp__igp_di_mes.sql diff --git a/models/br_fgv_igp/br_fgv_igp__igp_di_mes.sql b/models/br_fgv_igp/br_fgv_igp__igp_di_mes.sql deleted file mode 100644 index ed780e88..00000000 --- a/models/br_fgv_igp/br_fgv_igp__igp_di_mes.sql +++ /dev/null @@ -1,35 +0,0 @@ -{{ - config( - alias='igp_di_mes', - schema='br_fgv_igp', - materialized='incremental', - partition_by = { - "field": "ano", - "data_type": "int64", - "range": { - "start": 1944, - "end": 2024, - "interval": 1} - }, - post_hook=['CREATE OR REPLACE ROW ACCESS POLICY allusers_filter - ON {{this}} - GRANT TO ("allUsers") - FILTER USING (DATE_DIFF(DATE("{{ run_started_at.strftime("%Y-%m-%d") }}"),DATE(CAST(ano AS INT64),CAST(mes AS INT64),1), MONTH) > 6)', - 'CREATE OR REPLACE ROW ACCESS POLICY bdpro_filter - ON {{this}} - GRANT TO ("group:bd-pro@basedosdados.org", "group:sudo@basedosdados.org") - FILTER USING (DATE_DIFF(DATE("{{ run_started_at.strftime("%Y-%m-%d") }}"),DATE(CAST(ano AS INT64),CAST(mes AS INT64),1), MONTH) <= 6)'] - ) -}} -SELECT -SAFE_CAST(ano AS INT64) ano, -SAFE_CAST(mes AS INT64) mes, -SAFE_CAST(indice AS FLOAT64) indice, -SAFE_CAST(variacao_mensal AS FLOAT64) variacao_mensal, -SAFE_CAST(variacao_12_meses AS FLOAT64) variacao_12_meses, -SAFE_CAST(variacao_acumulada_ano AS FLOAT64) variacao_acumulada_ano, -SAFE_CAST(indice_fechamento_mensal AS FLOAT64) indice_fechamento_mensal -FROM basedosdados-dev.br_fgv_igp_staging.igp_di_mes AS t -{% if is_incremental() %} -WHERE DATE(CAST(ano AS INT64),CAST(mes AS INT64),1) > (SELECT MAX(DATE(CAST(ano AS INT64),CAST(mes AS INT64),1)) FROM {{ this }} ) -{% endif %} \ No newline at end of file