Skip to content

Commit

Permalink
feat: update caged 01-24
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurfg committed Mar 18, 2024
1 parent e74da5a commit 641f651
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions models/br_me_caged/microdados_movimentacao.sql
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
partition_by={
"field": "ano",
"data_type": "int64",
"range": {"start": 2020, "end": 2023, "interval": 1},
"range": {"start": 2020, "end": 2024, "interval": 1},
},
cluster_by=["mes", "sigla_uf"],
labels={"project_id": "basedosdados", "tema": "economia"},
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(DATE(2024,1,30),DATE(CAST(ano AS INT64),CAST(mes AS INT64),1), MONTH) > 6 OR DATE_DIFF(DATE(2023,5,1),DATE(CAST(ano AS INT64),CAST(mes AS INT64),1), MONTH) > 0)',
'CREATE OR REPLACE ROW ACCESS POLICY allusers_filter ON {{this}} GRANT TO ("allUsers") FILTER USING (DATE_DIFF(DATE(2024,3,18),DATE(CAST(ano AS INT64),CAST(mes AS INT64),1), MONTH) > 6 OR DATE_DIFF(DATE(2023,5,1),DATE(CAST(ano AS INT64),CAST(mes AS INT64),1), MONTH) > 0)',
'CREATE OR REPLACE ROW ACCESS POLICY bdpro_filter ON {{this}} GRANT TO ("group:[email protected]", "group:[email protected]") FILTER USING (True)',
],
)
Expand Down
4 changes: 2 additions & 2 deletions models/br_me_caged/microdados_movimentacao_excluida.sql
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
partition_by={
"field": "ano",
"data_type": "int64",
"range": {"start": 2020, "end": 2023, "interval": 1},
"range": {"start": 2020, "end": 2024, "interval": 1},
},
cluster_by=["mes", "sigla_uf"],
labels={"project_id": "basedosdados", "tema": "economia"},
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(DATE(2024,1,30),DATE(CAST(ano AS INT64),CAST(mes AS INT64),1), MONTH) > 6 OR DATE_DIFF(DATE(2023,5,1),DATE(CAST(ano AS INT64),CAST(mes AS INT64),1), MONTH) > 0)',
'CREATE OR REPLACE ROW ACCESS POLICY allusers_filter ON {{this}} GRANT TO ("allUsers") FILTER USING (DATE_DIFF(DATE(2024,3,18),DATE(CAST(ano AS INT64),CAST(mes AS INT64),1), MONTH) > 6 OR DATE_DIFF(DATE(2023,5,1),DATE(CAST(ano AS INT64),CAST(mes AS INT64),1), MONTH) > 0)',
'CREATE OR REPLACE ROW ACCESS POLICY bdpro_filter ON {{this}} GRANT TO ("group:[email protected]", "group:[email protected]") FILTER USING (True)',
],
)
Expand Down
4 changes: 2 additions & 2 deletions models/br_me_caged/microdados_movimentacao_fora_prazo.sql
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
partition_by={
"field": "ano",
"data_type": "int64",
"range": {"start": 2020, "end": 2023, "interval": 1},
"range": {"start": 2020, "end": 2024, "interval": 1},
},
cluster_by=["mes", "sigla_uf"],
labels={"project_id": "basedosdados", "tema": "economia"},
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(DATE(2024,1,30),DATE(CAST(ano AS INT64),CAST(mes AS INT64),1), MONTH) > 6 OR DATE_DIFF(DATE(2023,5,1),DATE(CAST(ano AS INT64),CAST(mes AS INT64),1), MONTH) > 0)',
'CREATE OR REPLACE ROW ACCESS POLICY allusers_filter ON {{this}} GRANT TO ("allUsers") FILTER USING (DATE_DIFF(DATE(2024,3,18),DATE(CAST(ano AS INT64),CAST(mes AS INT64),1), MONTH) > 6 OR DATE_DIFF(DATE(2023,5,1),DATE(CAST(ano AS INT64),CAST(mes AS INT64),1), MONTH) > 0)',
'CREATE OR REPLACE ROW ACCESS POLICY bdpro_filter ON {{this}} GRANT TO ("group:[email protected]", "group:[email protected]") FILTER USING (True)',
],
)
Expand Down

0 comments on commit 641f651

Please sign in to comment.