-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into staging/radar-serpro
- Loading branch information
Showing
10 changed files
with
118 additions
and
16 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
pipelines/migration/br_rj_riodejaneiro_onibus_gps/CHANGELOG.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
pipelines/migration/br_rj_riodejaneiro_onibus_gps/constants.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
Constant values for rj_smtr br_rj_riodejaneiro_onibus_gps | ||
""" | ||
|
||
from enum import Enum | ||
|
||
|
||
class constants(Enum): # pylint: disable=c0103 | ||
""" | ||
Constant values for rj_smtr br_rj_riodejaneiro_onibus_gps | ||
""" | ||
|
||
GPS_DATA_CHECKS_LIST = { | ||
"gps_sppo": { | ||
"unique_columns__gps_sppo": {"description": "Todos os registros são únicos"}, | ||
"not_null__timestamp_gps__gps_sppo": { | ||
"description": "Todos os registros possuem timestamp_gps não nulo" | ||
}, | ||
"not_null__id_veiculo__gps_sppo": { | ||
"description": "Todos os registros possuem id_veiculo não nulo" | ||
}, | ||
"not_null__servico__gps_sppo": { | ||
"description": "Todos os registros possuem servico não nulo" | ||
}, | ||
"not_null__latitude__gps_sppo": { | ||
"description": "Todos os registros possuem latitude não nula" | ||
}, | ||
"not_null__longitude__gps_sppo": { | ||
"description": "Todos os registros possuem longitude não nula" | ||
}, | ||
"not_null__status__gps_sppo": { | ||
"description": "Todos os registros possuem servico não nulo" | ||
}, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{% macro get_where_subquery(relation) -%} | ||
{% set where = config.get('where') %} | ||
{% if where %} | ||
{% if "__date_range_start__" in where %} | ||
{# replace placeholder string with result of custom macro #} | ||
{% set date_range_start = var('date_range_start') %} | ||
{% set where = where | replace("__date_range_start__", date_range_start) %} | ||
{% endif %} | ||
{% if "__date_range_end__" in where %} | ||
{# replace placeholder string with result of custom macro #} | ||
{% set date_range_end = var('date_range_end') %} | ||
{% set where = where | replace("__date_range_end__", date_range_end) %} | ||
{% endif %} | ||
{%- set filtered -%} | ||
(select * from {{ relation }} where {{ where }}) dbt_subquery | ||
{%- endset -%} | ||
{% do return(filtered) %} | ||
{%- else -%} | ||
{% do return(relation) %} | ||
{%- endif -%} | ||
{%- endmacro %} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters