Skip to content

Commit

Permalink
fix: temporary remove pre hook to materialize table
Browse files Browse the repository at this point in the history
  • Loading branch information
folhesgabriel committed Feb 27, 2024
1 parent 0c59538 commit 0367fb3
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 12 deletions.
6 changes: 0 additions & 6 deletions models/br_ms_cnes/br_ms_cnes__estabelecimento.sql
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@
"data_type": "int64",
"range": {"start": 2005, "end": 2024, "interval": 1},
},
pre_hook="DROP ALL ROW ACCESS POLICIES ON {{ this }}",
post_hook=[
'CREATE OR REPLACE ROW ACCESS POLICY allusers_filter ON {{this}} GRANT TO ("allUsers") FILTER USING (DATE_DIFF(CURRENT_DATE(),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:[email protected]", "group:[email protected]") FILTER USING (True)',
],
)
}}
with
Expand Down Expand Up @@ -272,7 +267,6 @@ select
from cnes_add_muni
{% 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 %}
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@
"data_type": "int64",
"range": {"start": 2005, "end": 2024, "interval": 1},
},
pre_hook="DROP ALL ROW ACCESS POLICIES ON {{ this }}",
post_hook=[
'CREATE OR REPLACE ROW ACCESS POLICY allusers_filter ON {{this}} GRANT TO ("allUsers") FILTER USING (DATE_DIFF(CURRENT_DATE(),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:[email protected]", "group:[email protected]") FILTER USING (True)',
],
)
}}
with
Expand Down
2 changes: 1 addition & 1 deletion models/br_ms_cnes/br_ms_cnes__habilitacao.sql
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ with
raw_cnes_habilitacaol as (
-- 1. Retirar linhas com id_estabelecimento_cnes nulo
select *
from `basedosdados-dev.br_ms_cnes_staging.habilitacao`
from `basedosdados-staging.br_ms_cnes_staging.habilitacao`
where cnes is not null
),
raw_cnes_habilitacao_without_duplicates as (
Expand Down

0 comments on commit 0367fb3

Please sign in to comment.