Skip to content

Commit

Permalink
Merge pull request #515 from basedosdados/update-mme-energia
Browse files Browse the repository at this point in the history
[update/fix] br_mme_consumo_energia_eletrica
  • Loading branch information
tricktx authored Mar 25, 2024
2 parents 262e1bb + 42bd48c commit b211cc7
Show file tree
Hide file tree
Showing 5 changed files with 434 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .user.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
id: cc3f54e0-fd01-4495-bd12-aa41f3b24444
3 changes: 3 additions & 0 deletions dbt_project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,9 @@ models:
+post-hook:
- REVOKE `roles/bigquery.dataViewer` ON TABLE {{ this }} FROM "specialGroup:allUsers"
- GRANT `roles/bigquery.dataViewer` ON TABLE {{ this }} TO "group:[email protected]"
br_mme_consumo_energia_eletrica:
+materialized: table
+schema: br_mme_consumo_energia_eletrica
br_mp_pep:
+materialized: table
+schema: br_mp_pep
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{{
config(
alias="uf",
schema="br_mme_consumo_energia_eletrica",
materialized="table",
)
}}
select
safe_cast(ano as int64) as ano,
safe_cast(mes as int64) as mes,
safe_cast(sigla_uf as string) as sigla_uf,
safe_cast(tipo_consumo as string) as tipo_consumo,
case
when numero_consumidores = '0'
then null
else safe_cast(numero_consumidores as int64)
end as numero_consumidores,
safe_cast(consumo as int64) as consumo
from `basedosdados-staging.br_mme_consumo_energia_eletrica_staging.uf` as t
Loading

0 comments on commit b211cc7

Please sign in to comment.