Skip to content

Commit

Permalink
Merge branch 'main' into add-taxa-alfabetizacao-saeb
Browse files Browse the repository at this point in the history
  • Loading branch information
aspeddro authored May 24, 2024
2 parents 96b6ab1 + 971a8b5 commit 8df0e0b
Show file tree
Hide file tree
Showing 11 changed files with 424 additions and 3 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/elementary.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ jobs:
warehouse-type: bigquery
adapter-version: 1.5.9
profiles-yml: ${{ secrets.ELEMENTARY_PROFILES_YML }}
edr-command: edr report --file-path "report.html" --days-back 90 && edr send-report --google-service-account-path
"/tmp/gcs_keyfile.json" --gcs-bucket-name "basedosdados" --update-bucket-website "true" --days-back 90
edr-command: edr report --file-path "report.html" --days-back 90 && edr
send-report --google-service-account-path "/tmp/gcs_keyfile.json" --gcs-bucket-name
"basedosdados" --update-bucket-website "true" --days-back 90
bigquery-keyfile: ${{ secrets.BIGQUERY_KEYFILE }}
gcs-keyfile: ${{ secrets.GCS_KEYFILE }}
- name: Upload report
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/triggers-elementary-model.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
schedule:
- cron: 00 23 * * 1
workflow_dispatch:

jobs:
run_elementary_models:
name: Run elementary model
Expand Down
3 changes: 3 additions & 0 deletions dbt_project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,9 @@ models:
br_me_sic:
+materialized: table
+schema: br_me_sic
br_me_siconfi:
+materialized: table
+schema: br_me_siconfi
br_mec_prouni:
+materialized: table
+schema: br_mec_prouni
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{{
config(
schema="br_me_siconfi",
alias="municipio_balanco_patrimonial",
materialized="table",
partition_by={
"field": "ano",
"data_type": "int64",
"range": {"start": 1998, "end": 2024, "interval": 1},
},
)
}}


select
safe_cast(ano as int64) ano,
safe_cast(sigla_uf as string) sigla_uf,
safe_cast(id_municipio as string) id_municipio,
safe_cast(portaria as string) portaria,
safe_cast(conta as string) conta,
safe_cast(id_conta_bd as string) id_conta_bd,
safe_cast(conta_bd as string) conta_bd,
safe_cast(valor as float64) valor
from `basedosdados-staging.br_me_siconfi_staging.municipio_balanco_patrimonial` as t
25 changes: 25 additions & 0 deletions models/br_me_siconfi/br_me_siconfi__municipio_despesas_funcao.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{{
config(
schema="br_me_siconfi",
alias="municipio_despesas_funcao",
materialized="table",
partition_by={
"field": "ano",
"data_type": "int64",
"range": {"start": 2004, "end": 2024, "interval": 1},
},
)
}}

select
safe_cast(ano as int64) ano,
safe_cast(sigla_uf as string) sigla_uf,
safe_cast(id_municipio as string) id_municipio,
safe_cast(estagio as string) estagio,
safe_cast(portaria as string) portaria,
safe_cast(conta as string) conta,
safe_cast(estagio_bd as string) estagio_bd,
safe_cast(id_conta_bd as string) id_conta_bd,
safe_cast(conta_bd as string) conta_bd,
safe_cast(valor as float64) valor
from `basedosdados-staging.br_me_siconfi_staging.municipio_despesas_funcao` as t
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{{
config(
schema="br_me_siconfi",
alias="municipio_despesas_orcamentarias",
materialized="table",
partition_by={
"field": "ano",
"data_type": "int64",
"range": {"start": 1989, "end": 2024, "interval": 1},
},
)
}}

select
safe_cast(ano as int64) ano,
safe_cast(sigla_uf as string) sigla_uf,
safe_cast(id_municipio as string) id_municipio,
safe_cast(estagio as string) estagio,
safe_cast(portaria as string) portaria,
safe_cast(conta as string) conta,
safe_cast(estagio_bd as string) estagio_bd,
safe_cast(id_conta_bd as string) id_conta_bd,
safe_cast(conta_bd as string) conta_bd,
safe_cast(valor as float64) valor
from `basedosdados-staging.br_me_siconfi_staging.municipio_despesas_orcamentarias` as t
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{{
config(
schema="br_me_siconfi",
alias="municipio_receitas_orcamentarias",
materialized="table",
partition_by={
"field": "ano",
"data_type": "int64",
"range": {"start": 1989, "end": 2024, "interval": 1},
},
)
}}

select
safe_cast(ano as int64) ano,
safe_cast(sigla_uf as string) sigla_uf,
safe_cast(id_municipio as string) id_municipio,
safe_cast(estagio as string) estagio,
safe_cast(portaria as string) portaria,
safe_cast(conta as string) conta,
safe_cast(estagio_bd as string) estagio_bd,
safe_cast(id_conta_bd as string) id_conta_bd,
safe_cast(conta_bd as string) conta_bd,
safe_cast(valor as float64) valor
from `basedosdados-staging.br_me_siconfi_staging.municipio_receitas_orcamentarias` as t
25 changes: 25 additions & 0 deletions models/br_me_siconfi/br_me_siconfi__uf_despesas_funcao.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{{
config(
schema="br_me_siconfi",
alias="uf_despesas_funcao",
materialized="table",
partition_by={
"field": "ano",
"data_type": "int64",
"range": {"start": 2013, "end": 2024, "interval": 1},
},
)
}}

select
safe_cast(ano as int64) ano,
safe_cast(sigla_uf as string) sigla_uf,
safe_cast(id_uf as string) id_uf,
safe_cast(estagio as string) estagio,
safe_cast(portaria as string) portaria,
safe_cast(conta as string) conta,
safe_cast(estagio_bd as string) estagio_bd,
safe_cast(id_conta_bd as string) id_conta_bd,
safe_cast(conta_bd as string) conta_bd,
safe_cast(valor as float64) valor
from `basedosdados-staging.br_me_siconfi_staging.uf_despesas_funcao` as t
25 changes: 25 additions & 0 deletions models/br_me_siconfi/br_me_siconfi__uf_despesas_orcamentarias.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{{
config(
schema="br_me_siconfi",
alias="uf_despesas_orcamentarias",
materialized="table",
partition_by={
"field": "ano",
"data_type": "int64",
"range": {"start": 2013, "end": 2024, "interval": 1},
},
)
}}

select
safe_cast(ano as int64) ano,
safe_cast(sigla_uf as string) sigla_uf,
safe_cast(id_uf as string) id_uf,
safe_cast(estagio as string) estagio,
safe_cast(portaria as string) portaria,
safe_cast(conta as string) conta,
safe_cast(estagio_bd as string) estagio_bd,
safe_cast(id_conta_bd as string) id_conta_bd,
safe_cast(conta_bd as string) conta_bd,
safe_cast(valor as float64) valor
from `basedosdados-staging.br_me_siconfi_staging.uf_despesas_orcamentarias` as t
25 changes: 25 additions & 0 deletions models/br_me_siconfi/br_me_siconfi__uf_receitas_orcamentarias.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{{
config(
schema="br_me_siconfi",
alias="uf_receitas_orcamentarias",
materialized="table",
partition_by={
"field": "ano",
"data_type": "int64",
"range": {"start": 2013, "end": 2024, "interval": 1},
},
)
}}

select
safe_cast(ano as int64) ano,
safe_cast(sigla_uf as string) sigla_uf,
safe_cast(id_uf as string) id_uf,
safe_cast(estagio as string) estagio,
safe_cast(portaria as string) portaria,
safe_cast(conta as string) conta,
safe_cast(estagio_bd as string) estagio_bd,
safe_cast(id_conta_bd as string) id_conta_bd,
safe_cast(conta_bd as string) conta_bd,
safe_cast(valor as float64) valor
from `basedosdados-staging.br_me_siconfi_staging.uf_receitas_orcamentarias` as t
Loading

0 comments on commit 8df0e0b

Please sign in to comment.