Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[update/fix] br_mme_consumo_energia_eletrica #515

Merged
merged 5 commits into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading