From b2e383255de4c4a53be941018dd4b7375ebb6e3e Mon Sep 17 00:00:00 2001 From: Gagabrielle-carv Date: Thu, 21 Sep 2023 18:48:32 -0300 Subject: [PATCH 1/2] post_hook --- .../mundo_transfermarkt_competicoes__copa_brasil.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/models/mundo_transfermarkt_competicoes/mundo_transfermarkt_competicoes__copa_brasil.sql b/models/mundo_transfermarkt_competicoes/mundo_transfermarkt_competicoes__copa_brasil.sql index 0aa16265..d7100bd4 100644 --- a/models/mundo_transfermarkt_competicoes/mundo_transfermarkt_competicoes__copa_brasil.sql +++ b/models/mundo_transfermarkt_competicoes/mundo_transfermarkt_competicoes__copa_brasil.sql @@ -15,11 +15,11 @@ 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(data), YEAR) > 1)', + FILTER USING (DATE_DIFF(DATE("{{ run_started_at.strftime("%Y-%m-%d") }}"), DATE(data), week) > 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(data), YEAR) <= 1)' ] + FILTER USING (DATE_DIFF(DATE("{{ run_started_at.strftime("%Y-%m-%d") }}"), DATE(data), week) <= 6)' ] ) }} From 41e3df19ac6e23b625172ed5c9cf52ab1c75789d Mon Sep 17 00:00:00 2001 From: Gagabrielle-carv Date: Thu, 21 Sep 2023 19:05:22 -0300 Subject: [PATCH 2/2] MONTH --- .../mundo_transfermarkt_competicoes__copa_brasil.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/models/mundo_transfermarkt_competicoes/mundo_transfermarkt_competicoes__copa_brasil.sql b/models/mundo_transfermarkt_competicoes/mundo_transfermarkt_competicoes__copa_brasil.sql index d7100bd4..82051ea1 100644 --- a/models/mundo_transfermarkt_competicoes/mundo_transfermarkt_competicoes__copa_brasil.sql +++ b/models/mundo_transfermarkt_competicoes/mundo_transfermarkt_competicoes__copa_brasil.sql @@ -15,11 +15,11 @@ 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(data), week) > 6)', + FILTER USING (DATE_DIFF(DATE("{{ run_started_at.strftime("%Y-%m-%d") }}"), DATE(data), 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(data), week) <= 6)' ] + FILTER USING (DATE_DIFF(DATE("{{ run_started_at.strftime("%Y-%m-%d") }}"), DATE(data), MONTH) <= 6)' ] ) }}