Skip to content

Commit

Permalink
Merge branch 'main' into cgu_receitas_orcamento
Browse files Browse the repository at this point in the history
  • Loading branch information
tricktx authored Jan 7, 2025
2 parents 11a14ad + 0f0ae58 commit 671f0db
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions models/br_stf_corte_aberta/br_stf_corte_aberta__decisoes.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,9 @@
partition_by={
"field": "ano",
"data_type": "int64",
"range": {"start": 2000, "end": 2023, "interval": 1},
"range": {"start": 2000, "end": 2025, "interval": 1},
},
labels={"tema": "direito"},
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_decisao), week) > 6)',
'CREATE OR REPLACE ROW ACCESS POLICY bdpro_filter ON {{this}} GRANT TO ("group:[email protected]", "group:[email protected]") FILTER USING (DATE_DIFF(DATE("{{ run_started_at.strftime("%Y-%m-%d") }}"), DATE(data_decisao), week) <= 6)',
],
)
}}

Expand All @@ -31,7 +27,7 @@ select
safe_cast(indicador_tramitacao as bool) indicador_tramitacao,
initcap(assunto_processo) assunto_processo,
initcap(ramo_direito) ramo_direito,
safe_cast(data_autuacao as date) data_autuacao,
safe_cast(data_decisao as date) data_decisao,
safe_cast(data_baixa_processo as date) data_baixa_processo
safe_cast(date(data_autuacao) as date) data_autuacao,
safe_cast(date(data_decisao) as date) data_decisao,
safe_cast(date(data_baixa_processo) as date) data_baixa_processo
from `basedosdados-staging.br_stf_corte_aberta_staging.decisoes` as t

0 comments on commit 671f0db

Please sign in to comment.