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

[dbt] Fix Geobr Municipio #501

Merged
merged 3 commits into from
Mar 18, 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
6 changes: 3 additions & 3 deletions models/br_geobr_mapas/br_geobr_mapas__municipio.sql
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
}}

select
safe_cast(id_municipio as string) id_municipio,
safe_cast(sigla_uf as string) sigla_uf,
safe.st_geogfromtext(geometria) geometria
safe_cast(replace(code_muni, '.0', '') as string) id_municipio,
safe_cast(abbrev_state as string) sigla_uf,
safe.st_geogfromtext(geometry) geometria
from `basedosdados-staging.br_geobr_mapas_staging.municipio` as t
5 changes: 5 additions & 0 deletions models/br_geobr_mapas/schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ models:
(IBGE) e outros conjuntos oficiais de dados espaciais do Brasil. O pacote inclui
uma ampla variedade de conjuntos de dados geográficos como recursos simples,
disponíveis em várias escalas geográficas e por vários anos.
tests:
- dbt_utils.unique_combination_of_columns:
combination_of_columns: [id_municipio]
- not_null_proportion_multiple_columns:
at_least: 0.05
columns:
- name: id_municipio
description: ID Município IBGE - 7 Dígitos
Expand Down
Loading